Java how to read folder and list files in that folder in jar environment instead of IDE
问题 my problem is that I create a folder(name is IconResources) under src , in IconResources there are many pictures. Directory is like this: ProjectName src package 1 package 2 IconResources(this is the target folder) I want to list all picture files name and do something with those pictures. And I found that File.list() only works in IDE, if I export project to a jar to make a standalone, it cannot work. So I searched and found that I should use inputstream and outputstream. Now I find i/o