Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - does java has any api for tar and gzip?

 
Thread Tools Search this Thread
Old 02-25-2006, 10:31 AM   #1
Default does java has any api for tar and gzip?


hi,

Does java has any api for compressing files or folders by tar and
gzip?where do i get the library(jar) for this? i seen standard java api
only provides java.util.zip classes only. But it does not have any
classes for tar and gzip. Pls give me any links where i get libraires
downloadable.

thanks,
nagesh



Nagesh
  Reply With Quote
Old 02-25-2006, 10:41 AM   #2
Thomas Kellerer
 
Posts: n/a
Default Re: does java has any api for tar and gzip?
Nagesh wrote on 25.02.2006 11:31:
> hi,
>
> Does java has any api for compressing files or folders by tar and
> gzip?where do i get the library(jar) for this? i seen standard java api
> only provides java.util.zip classes only. But it does not have any
> classes for tar and gzip. Pls give me any links where i get libraires
> downloadable.
>


The standard libraries do supply gzip support:

http://java.sun.com/j2se/1.4.2/docs/...putStream.html
http://java.sun.com/j2se/1.4.2/docs/...putStream.html

at least that's what the docs say: "for reading compressed data in the GZIP format"

The Jakarta project seems to be working on tar support:

http://jakarta.apache.org/commons/sandbox/compress/

As this is obviously taken from the Ant sources, you might want to check them as
well.

A quick search in google revealed this as well:
http://www.trustice.com/java/tar/

Thomas




Thomas Kellerer
  Reply With Quote
Old 02-25-2006, 12:46 PM   #3
NOBODY
 
Posts: n/a
Default Re: does java has any api for tar and gzip?
> Does java has any api for compressing files or folders by tar and
> gzip?where do i get the library(jar) for this? i seen standard java
> api only provides java.util.zip classes only. But it does not have any
> classes for tar and gzip. Pls give me any links where i get libraires
> downloadable.



googgled 'jtar' (and you should try do the same sometimes...)
http://www.angelfire.com/on/vkjava/


Java supports GZIP, but the GZIPInputStream cannot read multi-member gzip,
that is, a concatenation of gzips, as per the rfc 1952 (see 2.2)
http://bugs.sun.com/bugdatabase/view...bug_id=4691425
http://www.faqs.org/rfcs/rfc1952.html (see 2.2)


Beware that gzipping in java is 3x slower than the linux gzip. I resort to
runtime exec('gzip -c') while passing data to stdin and reading it back
from stdout of the spawn process...! (you can wrap it all in a simple
outputstream implementation for a nice reusability).



NOBODY
  Reply With Quote
Old 02-25-2006, 11:59 PM   #4
Roedy Green
 
Posts: n/a
Default Re: does java has any api for tar and gzip?
On 25 Feb 2006 02:31:06 -0800, "Nagesh" <>
wrote, quoted or indirectly quoted someone who said :

>But it does not have any
>classes for tar and gzip.


GZIP yes. tar no. See http://mindprod.com/jgloss/gzip.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.


Roedy Green
  Reply With Quote
Old 02-27-2006, 11:17 AM   #5
Nagesh
 
Posts: n/a
Default Re: does java has any api for tar and gzip?
The following link was pretty good. Thank you very much Thomas.
http://www.trustice.com/java/tar/



nagesh



Nagesh
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46