![]() |
|
|
|||||||
![]() |
Java - does java has any api for tar and gzip? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
> 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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
The following link was pretty good. Thank you very much Thomas.
http://www.trustice.com/java/tar/ nagesh Nagesh |
|