You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Albretch Mueller (JIRA)" <ji...@apache.org> on 2011/06/27 19:02:47 UTC

[jira] [Created] (COMPRESS-137) TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);

TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: COMPRESS-137
                 URL: https://issues.apache.org/jira/browse/COMPRESS-137
             Project: Commons Compress
          Issue Type: Bug
          Components: Compressors
    Affects Versions: 1.1
         Environment: $ uname -a
Linux Microknoppix 2.6.31.6 #4 SMP PREEMPT Tue Nov 10 19:11:11 CET 2009 i686 GNU/Linux

$ java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)

$ echo $CLASSPATH
/media/sdb3/prjx/Java/JUtils:/media/sdb3/prjx/Java/JUtils/jars/commons-compress-1.1.jar:.
            Reporter: Albretch Mueller
            Priority: Critical
             Fix For: 1.1


~ 
 this is a test run using httpd-2.2.19.tar[.gz,bz2] to show what I mean
~ 
 lbrtchx
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
$ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
--2011-06-27 11:21:46--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
Resolving apache.cyberuse.com... 174.132.149.89
Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7113418 (6.8M) [application/x-gzip]
Saving to: `httpd-2.2.19.tar.gz'

100%[===...===>] 7,113,418    296K/s   in 24s     

2011-06-27 11:22:10 (285 KB/s) - `httpd-2.2.19.tar.gz' saved [7113418/7113418]

$ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
--2011-06-27 11:22:19--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
Resolving apache.cyberuse.com... 174.132.149.89
Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5322082 (5.1M) [application/x-bzip2]
Saving to: `httpd-2.2.19.tar.bz2'

100%[===...===>] 5,322,082    256K/s   in 25s     

2011-06-27 11:22:44 (207 KB/s) - `httpd-2.2.19.tar.bz2' saved [5322082/5322082]

$ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
--2011-06-27 11:22:51--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
Resolving www.apache.org... 140.211.11.131
Connecting to www.apache.org|140.211.11.131|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 54 [text/plain]
Saving to: `httpd-2.2.19.tar.gz.md5'

100%[===...===>] 54          --.-K/s   in 0s      

2011-06-27 11:22:51 (4.23 MB/s) - `httpd-2.2.19.tar.gz.md5' saved [54/54]

$ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
--2011-06-27 11:23:02--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
Resolving www.apache.org... 140.211.11.131
Connecting to www.apache.org|140.211.11.131|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 55 [text/plain]
Saving to: `httpd-2.2.19.tar.bz2.md5'

100%[===...===>] 55          --.-K/s   in 0s      

2011-06-27 11:23:02 (4.91 MB/s) - `httpd-2.2.19.tar.bz2.md5' saved [55/55]

$ ls -l httpd-2.2.19.tar.*
-rw-r--r-- 1 knoppix knoppix 5322082 May 21 18:58 httpd-2.2.19.tar.bz2
-rw-r--r-- 1 knoppix knoppix      55 May 21 18:58 httpd-2.2.19.tar.bz2.md5
-rw-r--r-- 1 knoppix knoppix 7113418 May 21 18:58 httpd-2.2.19.tar.gz
-rw-r--r-- 1 knoppix knoppix      54 May 21 18:58 httpd-2.2.19.tar.gz.md5
$ md5sum -b httpd-2.2.19.tar.bz2
832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
$ md5sum -b httpd-2.2.19.tar.gz
e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
$ cat *.md5
832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 


/*
 TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
*/

import org.apache.commons.compress.compressors.bzip2.*;
import org.apache.commons.compress.compressors.gzip.*;
import org.apache.commons.compress.archivers.tar.*;
import org.apache.commons.compress.utils.*;
import org.apache.commons.compress.archivers.*;

import java.io.*;
import java.util.*;
import java.text.*;

// __ 
public class TAR00Test{
// __ 
 public static void main(String[] args){
// __ 
  TarArchiveInputStream TArkIS = null;
  TarArchiveEntry TArkEntry = null;

  File TARFl, IFl, IDir = new File("/media/sda1/prjx/sw/text_synch/XML_Fls/test");
  String[] aIFl = new String[]{"httpd-2.2.19.tar.bz2", "httpd-2.2.19.tar.gz"};

  String aFlPth;
// __ 
  try{
   for(int i = 0; (i < aIFl.length); ++i){
    IFl = new File(IDir, aIFl[i]);
    aFlPth = IFl.getCanonicalPath();
    if(IFl.exists()){
     aFlPth = aFlPth.toLowerCase();
// __ 
     if(aFlPth.endsWith(".tar.bz2")){
      TArkIS = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(IFl)));
     }
     else if(aFlPth.endsWith(".tar.gz")){
      TArkIS = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(IFl)));
     }
     else{} // ...
// __ 
     TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
     while(TArkEntry != null){
      if(!TArkEntry.isDirectory()){
       System.err.println(TArkEntry);
// __ org/apache/commons/compress/archivers/tar/TarArchiveEntry.html
       System.err.println("// __ getName: |" + TArkEntry.getName() + "|");
       System.err.println("// __ getSize: |" + TArkEntry.getSize() + "|");
       System.err.println("// __ getUserId: |" + TArkEntry.getUserId() + "|");
       System.err.println("// __ GroupId: |" + TArkEntry.getGroupId() + "|");
       System.err.println("// __ GroupName: |" + TArkEntry.getGroupName() + "|");
       System.err.println("// __ LastModifiedDate: |" + TArkEntry.getLastModifiedDate() + "|");
       System.err.println("// __ LinkName: |" + TArkEntry.getLinkName() + "|");
       System.err.println("// __ Mode: |" + TArkEntry.getMode() + "|");
       System.err.println("// __ ModTime: |" + TArkEntry.getModTime() + "|");
       TARFl = TArkEntry.getFile();
       System.err.println("// __ File: |" + TARFl + "|");

       if(TARFl != null){ System.err.println("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~"); }
       else{ System.err.println("~"); }

      }
      TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
     }
// __ 
     TArkIS.close();
    }// (IFl.exists())
    else{ System.err.println("// __ File not found! |" + aFlPth + "|"); }
   }// i [0, aIFl.length)
  }catch(FileNotFoundException FlNFX){ FlNFX.printStackTrace(System.err); }
    catch(IOException IOX){ IOX.printStackTrace(System.err); }
 }
}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (COMPRESS-137) TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);

Posted by "Torsten Curdt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COMPRESS-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torsten Curdt resolved COMPRESS-137.
------------------------------------

    Resolution: Not A Problem
      Assignee: Torsten Curdt

> TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-137
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-137
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>    Affects Versions: 1.1
>         Environment: $ uname -a
> Linux Microknoppix 2.6.31.6 #4 SMP PREEMPT Tue Nov 10 19:11:11 CET 2009 i686 GNU/Linux
> $ java -version
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
> $ echo $CLASSPATH
> /media/sdb3/prjx/Java/JUtils:/media/sdb3/prjx/Java/JUtils/jars/commons-compress-1.1.jar:.
>            Reporter: Albretch Mueller
>            Assignee: Torsten Curdt
>            Priority: Critical
>              Labels: zip_through_XMLReader
>             Fix For: 1.1
>
>
> ~ 
>  this is a test run using httpd-2.2.19.tar[.gz,bz2] to show what I mean
> ~ 
>  lbrtchx
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> --2011-06-27 11:21:46--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 7113418 (6.8M) [application/x-gzip]
> Saving to: `httpd-2.2.19.tar.gz'
> 100%[===...===>] 7,113,418    296K/s   in 24s     
> 2011-06-27 11:22:10 (285 KB/s) - `httpd-2.2.19.tar.gz' saved [7113418/7113418]
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> --2011-06-27 11:22:19--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 5322082 (5.1M) [application/x-bzip2]
> Saving to: `httpd-2.2.19.tar.bz2'
> 100%[===...===>] 5,322,082    256K/s   in 25s     
> 2011-06-27 11:22:44 (207 KB/s) - `httpd-2.2.19.tar.bz2' saved [5322082/5322082]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> --2011-06-27 11:22:51--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 54 [text/plain]
> Saving to: `httpd-2.2.19.tar.gz.md5'
> 100%[===...===>] 54          --.-K/s   in 0s      
> 2011-06-27 11:22:51 (4.23 MB/s) - `httpd-2.2.19.tar.gz.md5' saved [54/54]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> --2011-06-27 11:23:02--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 55 [text/plain]
> Saving to: `httpd-2.2.19.tar.bz2.md5'
> 100%[===...===>] 55          --.-K/s   in 0s      
> 2011-06-27 11:23:02 (4.91 MB/s) - `httpd-2.2.19.tar.bz2.md5' saved [55/55]
> $ ls -l httpd-2.2.19.tar.*
> -rw-r--r-- 1 knoppix knoppix 5322082 May 21 18:58 httpd-2.2.19.tar.bz2
> -rw-r--r-- 1 knoppix knoppix      55 May 21 18:58 httpd-2.2.19.tar.bz2.md5
> -rw-r--r-- 1 knoppix knoppix 7113418 May 21 18:58 httpd-2.2.19.tar.gz
> -rw-r--r-- 1 knoppix knoppix      54 May 21 18:58 httpd-2.2.19.tar.gz.md5
> $ md5sum -b httpd-2.2.19.tar.bz2
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> $ md5sum -b httpd-2.2.19.tar.gz
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> $ cat *.md5
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> /*
>  TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> */
> import org.apache.commons.compress.compressors.bzip2.*;
> import org.apache.commons.compress.compressors.gzip.*;
> import org.apache.commons.compress.archivers.tar.*;
> import org.apache.commons.compress.utils.*;
> import org.apache.commons.compress.archivers.*;
> import java.io.*;
> import java.util.*;
> import java.text.*;
> // __ 
> public class TAR00Test{
> // __ 
>  public static void main(String[] args){
> // __ 
>   TarArchiveInputStream TArkIS = null;
>   TarArchiveEntry TArkEntry = null;
>   File TARFl, IFl, IDir = new File("/media/sda1/prjx/sw/text_synch/XML_Fls/test");
>   String[] aIFl = new String[]{"httpd-2.2.19.tar.bz2", "httpd-2.2.19.tar.gz"};
>   String aFlPth;
> // __ 
>   try{
>    for(int i = 0; (i < aIFl.length); ++i){
>     IFl = new File(IDir, aIFl[i]);
>     aFlPth = IFl.getCanonicalPath();
>     if(IFl.exists()){
>      aFlPth = aFlPth.toLowerCase();
> // __ 
>      if(aFlPth.endsWith(".tar.bz2")){
>       TArkIS = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(IFl)));
>      }
>      else if(aFlPth.endsWith(".tar.gz")){
>       TArkIS = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(IFl)));
>      }
>      else{} // ...
> // __ 
>      TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      while(TArkEntry != null){
>       if(!TArkEntry.isDirectory()){
>        System.err.println(TArkEntry);
> // __ org/apache/commons/compress/archivers/tar/TarArchiveEntry.html
>        System.err.println("// __ getName: |" + TArkEntry.getName() + "|");
>        System.err.println("// __ getSize: |" + TArkEntry.getSize() + "|");
>        System.err.println("// __ getUserId: |" + TArkEntry.getUserId() + "|");
>        System.err.println("// __ GroupId: |" + TArkEntry.getGroupId() + "|");
>        System.err.println("// __ GroupName: |" + TArkEntry.getGroupName() + "|");
>        System.err.println("// __ LastModifiedDate: |" + TArkEntry.getLastModifiedDate() + "|");
>        System.err.println("// __ LinkName: |" + TArkEntry.getLinkName() + "|");
>        System.err.println("// __ Mode: |" + TArkEntry.getMode() + "|");
>        System.err.println("// __ ModTime: |" + TArkEntry.getModTime() + "|");
>        TARFl = TArkEntry.getFile();
>        System.err.println("// __ File: |" + TARFl + "|");
>        if(TARFl != null){ System.err.println("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~"); }
>        else{ System.err.println("~"); }
>       }
>       TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      }
> // __ 
>      TArkIS.close();
>     }// (IFl.exists())
>     else{ System.err.println("// __ File not found! |" + aFlPth + "|"); }
>    }// i [0, aIFl.length)
>   }catch(FileNotFoundException FlNFX){ FlNFX.printStackTrace(System.err); }
>     catch(IOException IOX){ IOX.printStackTrace(System.err); }
>  }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COMPRESS-137) TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);

Posted by "Stefan Bodewig (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COMPRESS-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157177#comment-13157177 ] 

Stefan Bodewig commented on COMPRESS-137:
-----------------------------------------

You can wrap the stream in something like the BoundedInputStream found as nested class in ZipFile or more conveniently in commons-io.
                
> TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-137
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-137
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>    Affects Versions: 1.1
>         Environment: $ uname -a
> Linux Microknoppix 2.6.31.6 #4 SMP PREEMPT Tue Nov 10 19:11:11 CET 2009 i686 GNU/Linux
> $ java -version
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
> $ echo $CLASSPATH
> /media/sdb3/prjx/Java/JUtils:/media/sdb3/prjx/Java/JUtils/jars/commons-compress-1.1.jar:.
>            Reporter: Albretch Mueller
>            Assignee: Torsten Curdt
>            Priority: Critical
>              Labels: zip_through_XMLReader
>             Fix For: 1.1
>
>
> ~ 
>  this is a test run using httpd-2.2.19.tar[.gz,bz2] to show what I mean
> ~ 
>  lbrtchx
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> --2011-06-27 11:21:46--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 7113418 (6.8M) [application/x-gzip]
> Saving to: `httpd-2.2.19.tar.gz'
> 100%[===...===>] 7,113,418    296K/s   in 24s     
> 2011-06-27 11:22:10 (285 KB/s) - `httpd-2.2.19.tar.gz' saved [7113418/7113418]
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> --2011-06-27 11:22:19--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 5322082 (5.1M) [application/x-bzip2]
> Saving to: `httpd-2.2.19.tar.bz2'
> 100%[===...===>] 5,322,082    256K/s   in 25s     
> 2011-06-27 11:22:44 (207 KB/s) - `httpd-2.2.19.tar.bz2' saved [5322082/5322082]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> --2011-06-27 11:22:51--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 54 [text/plain]
> Saving to: `httpd-2.2.19.tar.gz.md5'
> 100%[===...===>] 54          --.-K/s   in 0s      
> 2011-06-27 11:22:51 (4.23 MB/s) - `httpd-2.2.19.tar.gz.md5' saved [54/54]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> --2011-06-27 11:23:02--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 55 [text/plain]
> Saving to: `httpd-2.2.19.tar.bz2.md5'
> 100%[===...===>] 55          --.-K/s   in 0s      
> 2011-06-27 11:23:02 (4.91 MB/s) - `httpd-2.2.19.tar.bz2.md5' saved [55/55]
> $ ls -l httpd-2.2.19.tar.*
> -rw-r--r-- 1 knoppix knoppix 5322082 May 21 18:58 httpd-2.2.19.tar.bz2
> -rw-r--r-- 1 knoppix knoppix      55 May 21 18:58 httpd-2.2.19.tar.bz2.md5
> -rw-r--r-- 1 knoppix knoppix 7113418 May 21 18:58 httpd-2.2.19.tar.gz
> -rw-r--r-- 1 knoppix knoppix      54 May 21 18:58 httpd-2.2.19.tar.gz.md5
> $ md5sum -b httpd-2.2.19.tar.bz2
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> $ md5sum -b httpd-2.2.19.tar.gz
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> $ cat *.md5
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> /*
>  TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> */
> import org.apache.commons.compress.compressors.bzip2.*;
> import org.apache.commons.compress.compressors.gzip.*;
> import org.apache.commons.compress.archivers.tar.*;
> import org.apache.commons.compress.utils.*;
> import org.apache.commons.compress.archivers.*;
> import java.io.*;
> import java.util.*;
> import java.text.*;
> // __ 
> public class TAR00Test{
> // __ 
>  public static void main(String[] args){
> // __ 
>   TarArchiveInputStream TArkIS = null;
>   TarArchiveEntry TArkEntry = null;
>   File TARFl, IFl, IDir = new File("/media/sda1/prjx/sw/text_synch/XML_Fls/test");
>   String[] aIFl = new String[]{"httpd-2.2.19.tar.bz2", "httpd-2.2.19.tar.gz"};
>   String aFlPth;
> // __ 
>   try{
>    for(int i = 0; (i < aIFl.length); ++i){
>     IFl = new File(IDir, aIFl[i]);
>     aFlPth = IFl.getCanonicalPath();
>     if(IFl.exists()){
>      aFlPth = aFlPth.toLowerCase();
> // __ 
>      if(aFlPth.endsWith(".tar.bz2")){
>       TArkIS = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(IFl)));
>      }
>      else if(aFlPth.endsWith(".tar.gz")){
>       TArkIS = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(IFl)));
>      }
>      else{} // ...
> // __ 
>      TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      while(TArkEntry != null){
>       if(!TArkEntry.isDirectory()){
>        System.err.println(TArkEntry);
> // __ org/apache/commons/compress/archivers/tar/TarArchiveEntry.html
>        System.err.println("// __ getName: |" + TArkEntry.getName() + "|");
>        System.err.println("// __ getSize: |" + TArkEntry.getSize() + "|");
>        System.err.println("// __ getUserId: |" + TArkEntry.getUserId() + "|");
>        System.err.println("// __ GroupId: |" + TArkEntry.getGroupId() + "|");
>        System.err.println("// __ GroupName: |" + TArkEntry.getGroupName() + "|");
>        System.err.println("// __ LastModifiedDate: |" + TArkEntry.getLastModifiedDate() + "|");
>        System.err.println("// __ LinkName: |" + TArkEntry.getLinkName() + "|");
>        System.err.println("// __ Mode: |" + TArkEntry.getMode() + "|");
>        System.err.println("// __ ModTime: |" + TArkEntry.getModTime() + "|");
>        TARFl = TArkEntry.getFile();
>        System.err.println("// __ File: |" + TARFl + "|");
>        if(TARFl != null){ System.err.println("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~"); }
>        else{ System.err.println("~"); }
>       }
>       TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      }
> // __ 
>      TArkIS.close();
>     }// (IFl.exists())
>     else{ System.err.println("// __ File not found! |" + aFlPth + "|"); }
>    }// i [0, aIFl.length)
>   }catch(FileNotFoundException FlNFX){ FlNFX.printStackTrace(System.err); }
>     catch(IOException IOX){ IOX.printStackTrace(System.err); }
>  }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COMPRESS-137) TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);

Posted by "Albretch Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COMPRESS-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056898#comment-13056898 ] 

Albretch Mueller commented on COMPRESS-137:
-------------------------------------------

 OK, let me put it this way. There is:
~ 
 java/util/zip/ZipFile.html#getInputStream(java.util.zip.ZipEntry)
~ 
 Where is (something (even a hack!) like):
~ 
 final BZip2CompressorInputStream BZ2KIS = new BZip2CompressorInputStream(new FileInputStream(IFlBZ2));
 final TarArchiveInputStream TArkIS = new TarArchiveInputStream(BZ2KIS);
 TarArchiveEntry entry = (TarArchiveEntry)is.getNextEntry();
 InputStream EntryIS = TArkIS.getInputStream(entry);
~ 
 so that you may go then, may go:
~ 
 XMLReader XMLRdr = SAXPrsr.getXMLReader();
 BufferedReader BfrRdr = new BufferedReader(new InputStreamReader(EntryIS, "UTF-8"));
 XMLRdr.parse(new InputSource(BfrRdr));
~ 
 I am not sure if your answer to my question/request was that "getFile shouldn't be there to begin with" 
~ 
 Why do you have to untar the whole thing in order to get what you want?
~ 
 Why can't you get a grip just on the InputStream relating to one entry inside or a tarball? That was/is my question.
~ 
 Thanks
 lbrtchx

> TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-137
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-137
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>    Affects Versions: 1.1
>         Environment: $ uname -a
> Linux Microknoppix 2.6.31.6 #4 SMP PREEMPT Tue Nov 10 19:11:11 CET 2009 i686 GNU/Linux
> $ java -version
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
> $ echo $CLASSPATH
> /media/sdb3/prjx/Java/JUtils:/media/sdb3/prjx/Java/JUtils/jars/commons-compress-1.1.jar:.
>            Reporter: Albretch Mueller
>            Assignee: Torsten Curdt
>            Priority: Critical
>              Labels: zip_through_XMLReader
>             Fix For: 1.1
>
>
> ~ 
>  this is a test run using httpd-2.2.19.tar[.gz,bz2] to show what I mean
> ~ 
>  lbrtchx
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> --2011-06-27 11:21:46--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 7113418 (6.8M) [application/x-gzip]
> Saving to: `httpd-2.2.19.tar.gz'
> 100%[===...===>] 7,113,418    296K/s   in 24s     
> 2011-06-27 11:22:10 (285 KB/s) - `httpd-2.2.19.tar.gz' saved [7113418/7113418]
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> --2011-06-27 11:22:19--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 5322082 (5.1M) [application/x-bzip2]
> Saving to: `httpd-2.2.19.tar.bz2'
> 100%[===...===>] 5,322,082    256K/s   in 25s     
> 2011-06-27 11:22:44 (207 KB/s) - `httpd-2.2.19.tar.bz2' saved [5322082/5322082]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> --2011-06-27 11:22:51--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 54 [text/plain]
> Saving to: `httpd-2.2.19.tar.gz.md5'
> 100%[===...===>] 54          --.-K/s   in 0s      
> 2011-06-27 11:22:51 (4.23 MB/s) - `httpd-2.2.19.tar.gz.md5' saved [54/54]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> --2011-06-27 11:23:02--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 55 [text/plain]
> Saving to: `httpd-2.2.19.tar.bz2.md5'
> 100%[===...===>] 55          --.-K/s   in 0s      
> 2011-06-27 11:23:02 (4.91 MB/s) - `httpd-2.2.19.tar.bz2.md5' saved [55/55]
> $ ls -l httpd-2.2.19.tar.*
> -rw-r--r-- 1 knoppix knoppix 5322082 May 21 18:58 httpd-2.2.19.tar.bz2
> -rw-r--r-- 1 knoppix knoppix      55 May 21 18:58 httpd-2.2.19.tar.bz2.md5
> -rw-r--r-- 1 knoppix knoppix 7113418 May 21 18:58 httpd-2.2.19.tar.gz
> -rw-r--r-- 1 knoppix knoppix      54 May 21 18:58 httpd-2.2.19.tar.gz.md5
> $ md5sum -b httpd-2.2.19.tar.bz2
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> $ md5sum -b httpd-2.2.19.tar.gz
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> $ cat *.md5
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> /*
>  TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> */
> import org.apache.commons.compress.compressors.bzip2.*;
> import org.apache.commons.compress.compressors.gzip.*;
> import org.apache.commons.compress.archivers.tar.*;
> import org.apache.commons.compress.utils.*;
> import org.apache.commons.compress.archivers.*;
> import java.io.*;
> import java.util.*;
> import java.text.*;
> // __ 
> public class TAR00Test{
> // __ 
>  public static void main(String[] args){
> // __ 
>   TarArchiveInputStream TArkIS = null;
>   TarArchiveEntry TArkEntry = null;
>   File TARFl, IFl, IDir = new File("/media/sda1/prjx/sw/text_synch/XML_Fls/test");
>   String[] aIFl = new String[]{"httpd-2.2.19.tar.bz2", "httpd-2.2.19.tar.gz"};
>   String aFlPth;
> // __ 
>   try{
>    for(int i = 0; (i < aIFl.length); ++i){
>     IFl = new File(IDir, aIFl[i]);
>     aFlPth = IFl.getCanonicalPath();
>     if(IFl.exists()){
>      aFlPth = aFlPth.toLowerCase();
> // __ 
>      if(aFlPth.endsWith(".tar.bz2")){
>       TArkIS = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(IFl)));
>      }
>      else if(aFlPth.endsWith(".tar.gz")){
>       TArkIS = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(IFl)));
>      }
>      else{} // ...
> // __ 
>      TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      while(TArkEntry != null){
>       if(!TArkEntry.isDirectory()){
>        System.err.println(TArkEntry);
> // __ org/apache/commons/compress/archivers/tar/TarArchiveEntry.html
>        System.err.println("// __ getName: |" + TArkEntry.getName() + "|");
>        System.err.println("// __ getSize: |" + TArkEntry.getSize() + "|");
>        System.err.println("// __ getUserId: |" + TArkEntry.getUserId() + "|");
>        System.err.println("// __ GroupId: |" + TArkEntry.getGroupId() + "|");
>        System.err.println("// __ GroupName: |" + TArkEntry.getGroupName() + "|");
>        System.err.println("// __ LastModifiedDate: |" + TArkEntry.getLastModifiedDate() + "|");
>        System.err.println("// __ LinkName: |" + TArkEntry.getLinkName() + "|");
>        System.err.println("// __ Mode: |" + TArkEntry.getMode() + "|");
>        System.err.println("// __ ModTime: |" + TArkEntry.getModTime() + "|");
>        TARFl = TArkEntry.getFile();
>        System.err.println("// __ File: |" + TARFl + "|");
>        if(TARFl != null){ System.err.println("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~"); }
>        else{ System.err.println("~"); }
>       }
>       TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      }
> // __ 
>      TArkIS.close();
>     }// (IFl.exists())
>     else{ System.err.println("// __ File not found! |" + aFlPth + "|"); }
>    }// i [0, aIFl.length)
>   }catch(FileNotFoundException FlNFX){ FlNFX.printStackTrace(System.err); }
>     catch(IOException IOX){ IOX.printStackTrace(System.err); }
>  }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COMPRESS-137) TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);

Posted by "deyaa (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COMPRESS-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13154255#comment-13154255 ] 

deyaa commented on COMPRESS-137:
--------------------------------

I think what Torsten meant is that you should use the original TarArchiveInputStream to read the data of the next file, as shown here:
{code}			
is = new FileInputStream(tarfilename);
debInputStream = (TarArchiveInputStream) new ArchiveStreamFactory().createArchiveInputStream("tar", is);
TarArchiveEntry entry;
while ((entry = (TarArchiveEntry) debInputStream.getNextEntry()) != null) {
	final File entryFile = (entry).getFile();
	final String entryName = entry.getName();
	if (!entry.isDirectory()) {
		System.out.println("consuming file: " + entryName);
                Document doc = new SAXBuilder().build(debInputStream); 
	} else {
		System.out.println("consuming folder: " + entryName);
	}
}
{code}

The problem with this is that the ??depInputStream?? is closed by the ??SAXBuilder??, so the second call to ??debInputStream.getNextEntry()?? will throw ??java.io.IOException: input buffer is closed??


                
> TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-137
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-137
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>    Affects Versions: 1.1
>         Environment: $ uname -a
> Linux Microknoppix 2.6.31.6 #4 SMP PREEMPT Tue Nov 10 19:11:11 CET 2009 i686 GNU/Linux
> $ java -version
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
> $ echo $CLASSPATH
> /media/sdb3/prjx/Java/JUtils:/media/sdb3/prjx/Java/JUtils/jars/commons-compress-1.1.jar:.
>            Reporter: Albretch Mueller
>            Assignee: Torsten Curdt
>            Priority: Critical
>              Labels: zip_through_XMLReader
>             Fix For: 1.1
>
>
> ~ 
>  this is a test run using httpd-2.2.19.tar[.gz,bz2] to show what I mean
> ~ 
>  lbrtchx
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> --2011-06-27 11:21:46--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 7113418 (6.8M) [application/x-gzip]
> Saving to: `httpd-2.2.19.tar.gz'
> 100%[===...===>] 7,113,418    296K/s   in 24s     
> 2011-06-27 11:22:10 (285 KB/s) - `httpd-2.2.19.tar.gz' saved [7113418/7113418]
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> --2011-06-27 11:22:19--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 5322082 (5.1M) [application/x-bzip2]
> Saving to: `httpd-2.2.19.tar.bz2'
> 100%[===...===>] 5,322,082    256K/s   in 25s     
> 2011-06-27 11:22:44 (207 KB/s) - `httpd-2.2.19.tar.bz2' saved [5322082/5322082]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> --2011-06-27 11:22:51--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 54 [text/plain]
> Saving to: `httpd-2.2.19.tar.gz.md5'
> 100%[===...===>] 54          --.-K/s   in 0s      
> 2011-06-27 11:22:51 (4.23 MB/s) - `httpd-2.2.19.tar.gz.md5' saved [54/54]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> --2011-06-27 11:23:02--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 55 [text/plain]
> Saving to: `httpd-2.2.19.tar.bz2.md5'
> 100%[===...===>] 55          --.-K/s   in 0s      
> 2011-06-27 11:23:02 (4.91 MB/s) - `httpd-2.2.19.tar.bz2.md5' saved [55/55]
> $ ls -l httpd-2.2.19.tar.*
> -rw-r--r-- 1 knoppix knoppix 5322082 May 21 18:58 httpd-2.2.19.tar.bz2
> -rw-r--r-- 1 knoppix knoppix      55 May 21 18:58 httpd-2.2.19.tar.bz2.md5
> -rw-r--r-- 1 knoppix knoppix 7113418 May 21 18:58 httpd-2.2.19.tar.gz
> -rw-r--r-- 1 knoppix knoppix      54 May 21 18:58 httpd-2.2.19.tar.gz.md5
> $ md5sum -b httpd-2.2.19.tar.bz2
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> $ md5sum -b httpd-2.2.19.tar.gz
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> $ cat *.md5
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> /*
>  TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> */
> import org.apache.commons.compress.compressors.bzip2.*;
> import org.apache.commons.compress.compressors.gzip.*;
> import org.apache.commons.compress.archivers.tar.*;
> import org.apache.commons.compress.utils.*;
> import org.apache.commons.compress.archivers.*;
> import java.io.*;
> import java.util.*;
> import java.text.*;
> // __ 
> public class TAR00Test{
> // __ 
>  public static void main(String[] args){
> // __ 
>   TarArchiveInputStream TArkIS = null;
>   TarArchiveEntry TArkEntry = null;
>   File TARFl, IFl, IDir = new File("/media/sda1/prjx/sw/text_synch/XML_Fls/test");
>   String[] aIFl = new String[]{"httpd-2.2.19.tar.bz2", "httpd-2.2.19.tar.gz"};
>   String aFlPth;
> // __ 
>   try{
>    for(int i = 0; (i < aIFl.length); ++i){
>     IFl = new File(IDir, aIFl[i]);
>     aFlPth = IFl.getCanonicalPath();
>     if(IFl.exists()){
>      aFlPth = aFlPth.toLowerCase();
> // __ 
>      if(aFlPth.endsWith(".tar.bz2")){
>       TArkIS = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(IFl)));
>      }
>      else if(aFlPth.endsWith(".tar.gz")){
>       TArkIS = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(IFl)));
>      }
>      else{} // ...
> // __ 
>      TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      while(TArkEntry != null){
>       if(!TArkEntry.isDirectory()){
>        System.err.println(TArkEntry);
> // __ org/apache/commons/compress/archivers/tar/TarArchiveEntry.html
>        System.err.println("// __ getName: |" + TArkEntry.getName() + "|");
>        System.err.println("// __ getSize: |" + TArkEntry.getSize() + "|");
>        System.err.println("// __ getUserId: |" + TArkEntry.getUserId() + "|");
>        System.err.println("// __ GroupId: |" + TArkEntry.getGroupId() + "|");
>        System.err.println("// __ GroupName: |" + TArkEntry.getGroupName() + "|");
>        System.err.println("// __ LastModifiedDate: |" + TArkEntry.getLastModifiedDate() + "|");
>        System.err.println("// __ LinkName: |" + TArkEntry.getLinkName() + "|");
>        System.err.println("// __ Mode: |" + TArkEntry.getMode() + "|");
>        System.err.println("// __ ModTime: |" + TArkEntry.getModTime() + "|");
>        TARFl = TArkEntry.getFile();
>        System.err.println("// __ File: |" + TARFl + "|");
>        if(TARFl != null){ System.err.println("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~"); }
>        else{ System.err.println("~"); }
>       }
>       TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      }
> // __ 
>      TArkIS.close();
>     }// (IFl.exists())
>     else{ System.err.println("// __ File not found! |" + aFlPth + "|"); }
>    }// i [0, aIFl.length)
>   }catch(FileNotFoundException FlNFX){ FlNFX.printStackTrace(System.err); }
>     catch(IOException IOX){ IOX.printStackTrace(System.err); }
>  }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COMPRESS-137) TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);

Posted by "Albretch Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COMPRESS-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055662#comment-13055662 ] 

Albretch Mueller commented on COMPRESS-137:
-------------------------------------------

 Let me add that my goal (as explained in user@commons.apache.org: [compress] trying to feed data from tar.gz and tar.bz2 files directly to an XMLReader ...) is being able to do something like this:
~ 
  BufferedReader BfrRdr = null;
  XMLReader XMLRdr = null;
  FileInputStream FIS = null;
  ZipInputStream ZIS = null;
  ZipFile ZFl = null;
  int OPEN_READ = 0x1;
  ZipEntry ZEntry;
// __ 

  try{
   SAXParserFactory SAXFctry = SAXParserFactory.newInstance();
   SAXFctry.setValidating(false); // stop standard validation to allow custom schema
   SAXFctry.setNamespaceAware(true);

   SchemaFactory SchmFctry = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
   SAXFctry.setSchema(SchmFctry.newSchema(new Source[] {new StreamSource(aIXSDFl)}));
   SAXParser SAXPrsr = SAXFctry.newSAXParser();

// __ Create and register the content handler
   XMLRdr = SAXPrsr.getXMLReader();
   XMLRdr.setContentHandler(new DefaultHandler2());

// __ 
   File IZFl = new File(aIXMLFl);
   ZFl = new ZipFile(IZFl, OPEN_READ);
// __ 
   Enumeration<? extends ZipEntry> ZENum = ZFl.entries();
   while(ZENum.hasMoreElements()){
    ZEntry = (ZipEntry)ZENum.nextElement();
    System.out.println("// __ XML Scanning: |" + ZEntry.getName() + "|");
    InputStream IS = ZFl.getInputStream(ZEntry);
    BfrRdr = new BufferedReader(new InputStreamReader(IS, "UTF-8"));
// __ 
    XMLRdr.parse(new InputSource(BfrRdr)); // XMLReader is directly fed the InputStream from the zip file
// __ 
    IS.close();
   }
// __ 
  }catch(FileNotFoundException FNFX){ FNFX.printStackTrace(System.err); }
    catch(IOException IOX){ IOX.printStackTrace(System.err); }
   catch(ParserConfigurationException PrsConfX){ PrsConfX.printStackTrace(System.err); }
    catch(SAXException SAXX){ SAXX.printStackTrace(System.err); }


> TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-137
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-137
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>    Affects Versions: 1.1
>         Environment: $ uname -a
> Linux Microknoppix 2.6.31.6 #4 SMP PREEMPT Tue Nov 10 19:11:11 CET 2009 i686 GNU/Linux
> $ java -version
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
> $ echo $CLASSPATH
> /media/sdb3/prjx/Java/JUtils:/media/sdb3/prjx/Java/JUtils/jars/commons-compress-1.1.jar:.
>            Reporter: Albretch Mueller
>            Priority: Critical
>              Labels: zip_through_XMLReader
>             Fix For: 1.1
>
>
> ~ 
>  this is a test run using httpd-2.2.19.tar[.gz,bz2] to show what I mean
> ~ 
>  lbrtchx
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> --2011-06-27 11:21:46--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 7113418 (6.8M) [application/x-gzip]
> Saving to: `httpd-2.2.19.tar.gz'
> 100%[===...===>] 7,113,418    296K/s   in 24s     
> 2011-06-27 11:22:10 (285 KB/s) - `httpd-2.2.19.tar.gz' saved [7113418/7113418]
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> --2011-06-27 11:22:19--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 5322082 (5.1M) [application/x-bzip2]
> Saving to: `httpd-2.2.19.tar.bz2'
> 100%[===...===>] 5,322,082    256K/s   in 25s     
> 2011-06-27 11:22:44 (207 KB/s) - `httpd-2.2.19.tar.bz2' saved [5322082/5322082]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> --2011-06-27 11:22:51--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 54 [text/plain]
> Saving to: `httpd-2.2.19.tar.gz.md5'
> 100%[===...===>] 54          --.-K/s   in 0s      
> 2011-06-27 11:22:51 (4.23 MB/s) - `httpd-2.2.19.tar.gz.md5' saved [54/54]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> --2011-06-27 11:23:02--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 55 [text/plain]
> Saving to: `httpd-2.2.19.tar.bz2.md5'
> 100%[===...===>] 55          --.-K/s   in 0s      
> 2011-06-27 11:23:02 (4.91 MB/s) - `httpd-2.2.19.tar.bz2.md5' saved [55/55]
> $ ls -l httpd-2.2.19.tar.*
> -rw-r--r-- 1 knoppix knoppix 5322082 May 21 18:58 httpd-2.2.19.tar.bz2
> -rw-r--r-- 1 knoppix knoppix      55 May 21 18:58 httpd-2.2.19.tar.bz2.md5
> -rw-r--r-- 1 knoppix knoppix 7113418 May 21 18:58 httpd-2.2.19.tar.gz
> -rw-r--r-- 1 knoppix knoppix      54 May 21 18:58 httpd-2.2.19.tar.gz.md5
> $ md5sum -b httpd-2.2.19.tar.bz2
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> $ md5sum -b httpd-2.2.19.tar.gz
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> $ cat *.md5
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> /*
>  TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> */
> import org.apache.commons.compress.compressors.bzip2.*;
> import org.apache.commons.compress.compressors.gzip.*;
> import org.apache.commons.compress.archivers.tar.*;
> import org.apache.commons.compress.utils.*;
> import org.apache.commons.compress.archivers.*;
> import java.io.*;
> import java.util.*;
> import java.text.*;
> // __ 
> public class TAR00Test{
> // __ 
>  public static void main(String[] args){
> // __ 
>   TarArchiveInputStream TArkIS = null;
>   TarArchiveEntry TArkEntry = null;
>   File TARFl, IFl, IDir = new File("/media/sda1/prjx/sw/text_synch/XML_Fls/test");
>   String[] aIFl = new String[]{"httpd-2.2.19.tar.bz2", "httpd-2.2.19.tar.gz"};
>   String aFlPth;
> // __ 
>   try{
>    for(int i = 0; (i < aIFl.length); ++i){
>     IFl = new File(IDir, aIFl[i]);
>     aFlPth = IFl.getCanonicalPath();
>     if(IFl.exists()){
>      aFlPth = aFlPth.toLowerCase();
> // __ 
>      if(aFlPth.endsWith(".tar.bz2")){
>       TArkIS = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(IFl)));
>      }
>      else if(aFlPth.endsWith(".tar.gz")){
>       TArkIS = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(IFl)));
>      }
>      else{} // ...
> // __ 
>      TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      while(TArkEntry != null){
>       if(!TArkEntry.isDirectory()){
>        System.err.println(TArkEntry);
> // __ org/apache/commons/compress/archivers/tar/TarArchiveEntry.html
>        System.err.println("// __ getName: |" + TArkEntry.getName() + "|");
>        System.err.println("// __ getSize: |" + TArkEntry.getSize() + "|");
>        System.err.println("// __ getUserId: |" + TArkEntry.getUserId() + "|");
>        System.err.println("// __ GroupId: |" + TArkEntry.getGroupId() + "|");
>        System.err.println("// __ GroupName: |" + TArkEntry.getGroupName() + "|");
>        System.err.println("// __ LastModifiedDate: |" + TArkEntry.getLastModifiedDate() + "|");
>        System.err.println("// __ LinkName: |" + TArkEntry.getLinkName() + "|");
>        System.err.println("// __ Mode: |" + TArkEntry.getMode() + "|");
>        System.err.println("// __ ModTime: |" + TArkEntry.getModTime() + "|");
>        TARFl = TArkEntry.getFile();
>        System.err.println("// __ File: |" + TARFl + "|");
>        if(TARFl != null){ System.err.println("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~"); }
>        else{ System.err.println("~"); }
>       }
>       TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      }
> // __ 
>      TArkIS.close();
>     }// (IFl.exists())
>     else{ System.err.println("// __ File not found! |" + aFlPth + "|"); }
>    }// i [0, aIFl.length)
>   }catch(FileNotFoundException FlNFX){ FlNFX.printStackTrace(System.err); }
>     catch(IOException IOX){ IOX.printStackTrace(System.err); }
>  }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COMPRESS-137) TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);

Posted by "Torsten Curdt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COMPRESS-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056213#comment-13056213 ] 

Torsten Curdt commented on COMPRESS-137:
----------------------------------------

As demonstrated in 

https://svn.apache.org/repos/asf/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/ChainingTestCase.java

chaining works just fine.

You misunderstood the meaning of "getFile" (TBH I think that method should not exist at all) and are using the API the wrong way. Compress uses the same approach as the standard JDK classes.

In your case this means you need to find your ArchiveEntry and then the InputStream is positioned right where you need it. Search for "testTarUnarchive" to see an example.

> TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COMPRESS-137
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-137
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Compressors
>    Affects Versions: 1.1
>         Environment: $ uname -a
> Linux Microknoppix 2.6.31.6 #4 SMP PREEMPT Tue Nov 10 19:11:11 CET 2009 i686 GNU/Linux
> $ java -version
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
> $ echo $CLASSPATH
> /media/sdb3/prjx/Java/JUtils:/media/sdb3/prjx/Java/JUtils/jars/commons-compress-1.1.jar:.
>            Reporter: Albretch Mueller
>            Priority: Critical
>              Labels: zip_through_XMLReader
>             Fix For: 1.1
>
>
> ~ 
>  this is a test run using httpd-2.2.19.tar[.gz,bz2] to show what I mean
> ~ 
>  lbrtchx
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> --2011-06-27 11:21:46--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.gz
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 7113418 (6.8M) [application/x-gzip]
> Saving to: `httpd-2.2.19.tar.gz'
> 100%[===...===>] 7,113,418    296K/s   in 24s     
> 2011-06-27 11:22:10 (285 KB/s) - `httpd-2.2.19.tar.gz' saved [7113418/7113418]
> $ wget http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> --2011-06-27 11:22:19--  http://apache.cyberuse.com//httpd/httpd-2.2.19.tar.bz2
> Resolving apache.cyberuse.com... 174.132.149.89
> Connecting to apache.cyberuse.com|174.132.149.89|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 5322082 (5.1M) [application/x-bzip2]
> Saving to: `httpd-2.2.19.tar.bz2'
> 100%[===...===>] 5,322,082    256K/s   in 25s     
> 2011-06-27 11:22:44 (207 KB/s) - `httpd-2.2.19.tar.bz2' saved [5322082/5322082]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> --2011-06-27 11:22:51--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.gz.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 54 [text/plain]
> Saving to: `httpd-2.2.19.tar.gz.md5'
> 100%[===...===>] 54          --.-K/s   in 0s      
> 2011-06-27 11:22:51 (4.23 MB/s) - `httpd-2.2.19.tar.gz.md5' saved [54/54]
> $ wget http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> --2011-06-27 11:23:02--  http://www.apache.org/dist/httpd/httpd-2.2.19.tar.bz2.md5
> Resolving www.apache.org... 140.211.11.131
> Connecting to www.apache.org|140.211.11.131|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 55 [text/plain]
> Saving to: `httpd-2.2.19.tar.bz2.md5'
> 100%[===...===>] 55          --.-K/s   in 0s      
> 2011-06-27 11:23:02 (4.91 MB/s) - `httpd-2.2.19.tar.bz2.md5' saved [55/55]
> $ ls -l httpd-2.2.19.tar.*
> -rw-r--r-- 1 knoppix knoppix 5322082 May 21 18:58 httpd-2.2.19.tar.bz2
> -rw-r--r-- 1 knoppix knoppix      55 May 21 18:58 httpd-2.2.19.tar.bz2.md5
> -rw-r--r-- 1 knoppix knoppix 7113418 May 21 18:58 httpd-2.2.19.tar.gz
> -rw-r--r-- 1 knoppix knoppix      54 May 21 18:58 httpd-2.2.19.tar.gz.md5
> $ md5sum -b httpd-2.2.19.tar.bz2
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> $ md5sum -b httpd-2.2.19.tar.gz
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> $ cat *.md5
> 832f96a6ec4b8fc7cf49b9efd4e89060 *httpd-2.2.19.tar.bz2
> e9f5453e1e4d7aeb0e7ec7184c6784b5 *httpd-2.2.19.tar.gz
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
> /*
>  TarArchiveEntry.getFile() always returns null + no way to get an InputStream from TarArchiveInputStream similar to what you do with (java.util.zip.ZipFile())..getInputStream(ZipEntry);
> */
> import org.apache.commons.compress.compressors.bzip2.*;
> import org.apache.commons.compress.compressors.gzip.*;
> import org.apache.commons.compress.archivers.tar.*;
> import org.apache.commons.compress.utils.*;
> import org.apache.commons.compress.archivers.*;
> import java.io.*;
> import java.util.*;
> import java.text.*;
> // __ 
> public class TAR00Test{
> // __ 
>  public static void main(String[] args){
> // __ 
>   TarArchiveInputStream TArkIS = null;
>   TarArchiveEntry TArkEntry = null;
>   File TARFl, IFl, IDir = new File("/media/sda1/prjx/sw/text_synch/XML_Fls/test");
>   String[] aIFl = new String[]{"httpd-2.2.19.tar.bz2", "httpd-2.2.19.tar.gz"};
>   String aFlPth;
> // __ 
>   try{
>    for(int i = 0; (i < aIFl.length); ++i){
>     IFl = new File(IDir, aIFl[i]);
>     aFlPth = IFl.getCanonicalPath();
>     if(IFl.exists()){
>      aFlPth = aFlPth.toLowerCase();
> // __ 
>      if(aFlPth.endsWith(".tar.bz2")){
>       TArkIS = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(IFl)));
>      }
>      else if(aFlPth.endsWith(".tar.gz")){
>       TArkIS = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(IFl)));
>      }
>      else{} // ...
> // __ 
>      TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      while(TArkEntry != null){
>       if(!TArkEntry.isDirectory()){
>        System.err.println(TArkEntry);
> // __ org/apache/commons/compress/archivers/tar/TarArchiveEntry.html
>        System.err.println("// __ getName: |" + TArkEntry.getName() + "|");
>        System.err.println("// __ getSize: |" + TArkEntry.getSize() + "|");
>        System.err.println("// __ getUserId: |" + TArkEntry.getUserId() + "|");
>        System.err.println("// __ GroupId: |" + TArkEntry.getGroupId() + "|");
>        System.err.println("// __ GroupName: |" + TArkEntry.getGroupName() + "|");
>        System.err.println("// __ LastModifiedDate: |" + TArkEntry.getLastModifiedDate() + "|");
>        System.err.println("// __ LinkName: |" + TArkEntry.getLinkName() + "|");
>        System.err.println("// __ Mode: |" + TArkEntry.getMode() + "|");
>        System.err.println("// __ ModTime: |" + TArkEntry.getModTime() + "|");
>        TARFl = TArkEntry.getFile();
>        System.err.println("// __ File: |" + TARFl + "|");
>        if(TARFl != null){ System.err.println("~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~ * ~"); }
>        else{ System.err.println("~"); }
>       }
>       TArkEntry = (TarArchiveEntry)TArkIS.getNextEntry();
>      }
> // __ 
>      TArkIS.close();
>     }// (IFl.exists())
>     else{ System.err.println("// __ File not found! |" + aFlPth + "|"); }
>    }// i [0, aIFl.length)
>   }catch(FileNotFoundException FlNFX){ FlNFX.printStackTrace(System.err); }
>     catch(IOException IOX){ IOX.printStackTrace(System.err); }
>  }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira