0

The folder is /src/img. I need to get all file names(png files) from img folder and all subfolders.I dont know the full path to the folder so i need only to focus the project resourse. I need them in array. Using Java8 and Eclipse Mars. So far this works:

try {


Files.walk(Paths.get("/home/fixxxer/NetBeansProjects/Installer/src/img/")).forEach(filePath -> {
            if (Files.isRegularFile(filePath)) {
                System.out.println(filePath);
            }
        });
    } catch (IOException ex) {
        Logger.getLogger(InstallFrame.class.getName()).log(Level.SEVERE, null, ex);
    }

The problem is that the folder need to be called like this: /img cause it is inside the project Thanks in advance :)

Ralfi
  • 3
  • 2
  • The link you sent me is what ive tried so far. I need to focus only the local folder. In my case i dont know the full path to the folder cause user might be different... – Ralfi Aug 11 '16 at 16:35
  • so can you please unmark it or answer it... – Ralfi Aug 11 '16 at 17:11
  • Your question states *The folder is `/src/img`* so I'm not sure why you say you don't know the path to it. – Tunaki Aug 11 '16 at 19:02
  • yes but it is a project folder, not an OS folder – Ralfi Aug 12 '16 at 05:07

0 Answers0