Advertisement
iSach

Untitled

Jan 30th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public static void main(String[] args) {
  2. Test obj = new Test();
  3. for(File file : obj.getFile("files/").listFiles())
  4. System.out.println(file.getName());
  5. }
  6.  
  7. private File getFile(String fileName) {
  8. ClassLoader classLoader = getClass().getClassLoader();
  9. return new File(classLoader.getResource(fileName).getFile());
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement