I'm using the following code to try to walk through all the .class files in the current classpath, however it is throwing a NoSuchFileException before iterating once. Am I doing something wrong?
Enumeration<URL> systemResources = ClassLoader.getSystemResources("");
while (systemResources.hasMoreElements()) {
String fileName = systemResources.nextElement().getPath();
Stream<Path> filter = Files.walk(new File(fileName).toPath()).filter(Files::isRegularFile);
Consumer<Path> renameMe = (path) ->
{
System.out.println(path.toString());
};
filter.forEach(renameMe);
}
;