Last active
September 12, 2020 15:02
-
-
Save gdouzwt/57f6dfdf96138a7b41802b190529b3dd to your computer and use it in GitHub Desktop.
Get absolute path to file in /resources folder
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
URL res = getClass().getClassLoader().getResource("abc.txt"); | |
File file = Paths.get(res.toURI()).toFile(); | |
String absolutePath = file.getAbsolutePath(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment