Pack directory into a compressed tar file

Hi, experts,

I need to take all files in a directory and combine them into tar files of a given size, such as 2 Gigs each. Apache ANT has the necessary classes, but there are subtleties, and I am looking for some sample code to do this.

Thank you.
LVL 1
kerznerAsked:
Who is Participating?
 
objectsCommented:
theres an example of zipping here
http://helpdesk.objects.com.au/java/how-to-create-a-zip-file-containing-an-array-of-files

you could also jar (pretty much same as zip)


0
 
objectsCommented:
0
 
kerznerAuthor Commented:
I would expect ANT tar to work better, simply because it is under constant development - and beside ICE does not have any examples either.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
objectsCommented:
i may have misunderstood. doo u want to do it with ant, or call the ant class from your own java app

0
 
kerznerAuthor Commented:
I want to call any class from my application. Actually, I could use zip; it doesn't have to be tar - but there seem to be some advantages to using tar. For example, it will probably allow to do this trick: store the path and no contents for those files that I decide not to archive.
0
 
kerznerAuthor Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.