Reputation: 527
I'm looking for a simple package that I may simply call from command line (i.e. batch script) that can mostly replace the functionality of zip/unzip tools in Linux. Ideally, I'd be able to deploy the application (.jar file) to any machine that runs Java, tell it what to unzip and it does it's thing. This seems like it should be fairly simple and I don't want to re-invent the wheel, but I can't seem to find something like this. Thanks for any help!
Upvotes: 3
Views: 228
Reputation: 28697
The Ant tasks - zip and unzip should be of some benefit to you, if you don't want to completely re-invent the wheel. You could either call them as part of Ant, or call the task implementations directly using Java code.
Upvotes: 1
Reputation: 109081
You want to look at ZipInputStream and its brother ZipOutputStream if you want to build a tool yourself.
But seriously: what is the chance that you are running a tool on a system which does have Java installed, but does not have compression tools to perform zip and unzip?
Upvotes: 0
Reputation: 11433
I don't know a ready tool, but you could easily (a single class probably) write your own unzip tool in Java using the classes from java.util.zip, e.g. the ZipFile class.
Upvotes: 1