I am playing a bit with the new Java 7 IO features, actually I trying to receive all the xml files of a folder. But this throws an exception when the folder does not exist,
You need to transform your Path into a File and test for existence:
File
for(Path entry: stream){ if(entry.toFile().exists()){ log.info("working on file " + entry.getFileName()); } }