Skip to content

Instantly share code, notes, and snippets.

@hvasconcelos
Created December 5, 2014 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hvasconcelos/933a43a9575b6a6a7ad3 to your computer and use it in GitHub Desktop.
Save hvasconcelos/933a43a9575b6a6a7ad3 to your computer and use it in GitHub Desktop.
OS Independent Join Path
public static String joinPath(final String ... pathElements){
File path=File.listRoots()[0];
for(final String pathElement : pathElements)
path = new File(path, pathElement);
return path.getAbsolutePath();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment