code: private static File copyWithDecompression(final File resource,
              final String resourceLocation, final File copy)
              throws ResourceDownloadError {
          GZIPInputStream gzipis = null;
          FileOutputStream fout = null;
          try {
              MagicNumberFileFilter mnff = new MagicNumberFileFilter(
                      GZIP_MAGIC_NUMBER);
  
              if (mnff.accept(resource)) {
                  gzipis = new GZIPInputStream(new FileInputStream(
                          resource));
                  byte[] buffer = new byte[8192];
  
                  fout = new FileOutputStream(copy);
  
                  int length;
                  while ((length = gzipis.read(buffer, 0, 8192)) != -1) {
                      fout.write(buffer, 0, length);
                  }
              } else {
                  copyFile(resource, copy);
              }
          } catch (IOException e) {
              String msg = e.getMessage();
              ResourceDownloadError r =
                      new ResourceDownloadError(resourceLocation, msg);
              r.initCause(e);
              throw r;
          } finally {
              // clean up all I/O resources
              closeQuietly(fout);
              closeQuietly(gzipis);
          }
  
          return copy;
      }
docs: Copies the <tt>resource</tt> to <tt>copy</tt>.  Decompression is
  performed if the resource file is identified as a GZIP-encoded file.
  
  @param resource {@link File}, the resource to copy
  @param resourceLocation {@link String}, the resource location url
  @param copy {@link File}, the file to copy to
  @return {@link File}, the copied file
  @throws ResourceDownloadError Thrown if an IO error copying the resource