- a file with a given name;
- the file is located in the file system;
- the file can be loaded via the classpath;
(Don't peek if you want to give it a try!)
Answer:
String filePath = Thread.currentThread()
.getContextClassLoader()
.getResource(filename)
.getFile();
( From http://hansonchar.blogspot.com/)
No comments:
Post a Comment