Skip to content

Instantly share code, notes, and snippets.

@Baztoune
Created July 31, 2013 09:06
Show Gist options
  • Save Baztoune/6120559 to your computer and use it in GitHub Desktop.
Save Baztoune/6120559 to your computer and use it in GitHub Desktop.
Handle file path pattern in JNDI
<jndi:binding name="my/filePathPattern">
<jndi:value type="java.lang.String">C:/PATH/TO/%s/SUB/%s</jndi:value>
</jndi:binding>
String filePathPattern = (String) InitialContext.doLookup("my/filePathPattern");
StringBuilder filePath = new StringBuilder();
Formatter frmt = new Formatter(filePath);
frmt.format(filePathPattern,"firstStringParam","secondStringParam");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment