Class ZipHelper

java.lang.Object
io.bdeploy.common.util.ZipHelper

public class ZipHelper extends Object
  • Method Details

    • isZipUri

      public static boolean isZipUri(URI uri)
      Determines wheter a given URI points to a ZIP file.
    • zip

      public static void zip(Path zipFile, Path source)
      Creates a ZIP file from the given source directory. The targets parent directory must exist.

      In contrast to Java's built-in ZIP FileSystem, this will determine whether files should be executable and mark them accordingly, even when run on windows.

      Parameters:
      zipFile - the ZIP file to create
      source - the source directory
    • zip

      public static void zip(OutputStream output, Path source)
      Creates a ZIP stream from the given source directory.

      In contrast to Java's built-in ZIP FileSystem, this will determine whether files should be executable and mark them accordingly, even when run on windows.

      Parameters:
      output - the stream to write to.
      source - the source directory
    • unzip

      public static void unzip(Path zipFile, Path target)
      Unzip single ZIP file