Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-68

Filename suffix mappings for compression formats

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.0
    • None
    • None

    Description

      There are many file name suffix conventions like .tgz for gzipped .tar files and .svgz for gzipped .svg files. It would be useful if Commons Compress knew about these conventions and provided tools to help client applications to use these conventions.

      For example in Apache Tika we currently have the following custom code to deduce the original filename from a gzipped file:

      if (name.endsWith(".tgz")) {
          name = name.substring(0, name.length() - 4) + ".tar";
      } else if (name.endsWith(".gz") || name.endsWith("-gz")) {
          name = name.substring(0, name.length() - 3);
      } else if (name.toLowerCase().endsWith(".svgz")) {
          name = name.substring(0, name.length() - 1);
      } else if (name.toLowerCase().endsWith(".wmz")) {
          name = name.substring(0, name.length() - 1) + "f";
      } else if (name.toLowerCase().endsWith(".emz")) {
          name = name.substring(0, name.length() - 1) + "f";
      }
      

      It would be nice if we instead could do something like this:

          name = GzipUtils.getGunzipFilename(name);
      

      Attachments

        1. GzipUtils.patch
          11 kB
          Jukka Zitting

        Activity

          People

            Unassigned Unassigned
            jukkaz Jukka Zitting
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: