code: public static int getCompressionMethodOfEntry(File zip, String name) {
      ZipFile zf = null;
      try {
        zf = new ZipFile(zip);
        ZipEntry zipEntry = zf.getEntry(name);
        if (zipEntry == null) {
          return -1;
        }
        return zipEntry.getMethod();
      }
      catch (IOException e) {
        throw ZipExceptionUtil.rethrow(e);
      }
      finally {
        closeQuietly(zf);
      }
    }
docs: Returns the compression method of a given entry of the ZIP file.
  
  @param zip
  ZIP file.
  @param name
  entry name.
  @return Returns <code>ZipEntry.STORED</code>, <code>ZipEntry.DEFLATED</code> or -1 if
  the ZIP file does not contain the given entry.