Created
December 5, 2014 11:17
-
-
Save hvasconcelos/933a43a9575b6a6a7ad3 to your computer and use it in GitHub Desktop.
OS Independent Join Path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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