• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I jar a directory to a file programmically in Java  RSS feed

 
ken carlino
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How can I jar a directory to a file programmically in Java?
I know one way to do it is via System.exec(), but that seems to be heavy duty.

Can you please tell me if there is an more efficient way?

Thank you.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, the java.util.jar package is geared towards reding jar files only. But Jar files are just Zip files, really. I'm sure there are 3rd-party APIs around for creating those. E.g., Ant has jar and zip tasks - have a look at the Ant source what those do, and you should be well on your way.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!