ilija
ilija

Reputation: 563

How to programmatically search for a file inside some JAR?

How should I search and retrieve some x.txt file from a given JAR in Java? I guess, first I need to unzip it...

Upvotes: 0

Views: 388

Answers (1)

Miserable Variable
Miserable Variable

Reputation: 28752

Use a JarInputStream to open it, iterate over it using getNextJarEntry and compare names using ZipEntry.getName()

Upvotes: 3

Related Questions