Class ZipHelper

java.lang.Object
de.s42.base.zip.ZipHelper

public final class ZipHelper extends Object
Author:
Benjamin Schiller
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isArchive(int fileSignature)
    Tests if the file signature is a valid ZIP - see https://en.wikipedia.org/wiki/List_of_file_signatures
    static boolean
    Test if the given file is a ZIP archive.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ZipHelper

      private ZipHelper()
  • Method Details

    • isArchive

      public static boolean isArchive(Path file)
      Test if the given file is a ZIP archive. See https://stackoverflow.com/questions/33934178/how-to-identify-a-zip-file-in-java
      Parameters:
      file - this file will be tested if it is an archive
      Returns:
      true if the file contains the according file signature (fileSignature == 0x504B0304 || fileSignature == 0x504B0506 || fileSignature == 0x504B0708)
    • isArchive

      public static boolean isArchive(int fileSignature)
      Tests if the file signature is a valid ZIP - see https://en.wikipedia.org/wiki/List_of_file_signatures
      Parameters:
      fileSignature -
      Returns: