Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Test obj = new Test();
- for(File file : obj.getFile("files/").listFiles())
- System.out.println(file.getName());
- }
- private File getFile(String fileName) {
- ClassLoader classLoader = getClass().getClassLoader();
- return new File(classLoader.getResource(fileName).getFile());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement