How do I access the content of folders inside a jar file?
问题 I need to take a look at the names of files inside a specific package. Currently, I'm doing the following: ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL packageUrl = loader.getResource(getPackage().replace('.', '/')); File packageDir = new File(packageUrl.getFile()); // Work with the files inside the directory This actually works just fine in Eclipse, since it doesn't package my application by default. When I run it from a jar file, however, I get a