Results 1 to 2 of 2
  1. #1
    kathir0301 is offline Member
    Join Date
    Nov 2010
    Rep Power

    Default How to read filename inside .gz file?

    I want to know how to read name of file inside .gz file. im using GZIPInputStream to read .gz file.
    pls help me on this
    Thanks in advance

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    gzip is usually a compression file contents. that is, a gzip on its own does not have any additional headers, so there is no storage of the file name in a plain gzip. we could figure out what the file name was before gzipping it. For example, if the file was called "myfile.sql.gz", we could probably guess the file name by dropping the .gz suffix.

    Now, if the .gz file is a tar file, there is a Java Tar API that can read the tar file contents inside the gzip file, and then get the tar file names of the files stored inside the tar file.

Similar Threads

  1. how we can read inside all of files in a directory
    By cowboy2010 in forum New To Java
    Replies: 9
    Last Post: 08-03-2010, 04:55 PM
  2. how to read the ArrayList inside HashMap
    By koddy in forum New To Java
    Replies: 6
    Last Post: 07-15-2010, 01:41 PM
  3. I can't read a text file located inside my jar.
    By Serrano0811 in forum New To Java
    Replies: 1
    Last Post: 04-21-2010, 05:03 PM
  4. Replies: 4
    Last Post: 04-03-2010, 06:20 PM
  5. Replies: 2
    Last Post: 11-29-2009, 11:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts