Package org.basex.io

Class Zip


public final class Zip extends Job
Contains methods for zipping and unzipping archives.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • Zip

      public Zip(IO file)
      Constructor.
      Parameters:
      file - archive file
  • Method Details

    • read

      public byte[] read(String path) throws IOException
      Returns the contents of a zip file entry.
      Parameters:
      path - file to be read
      Returns:
      resulting byte array
      Throws:
      IOException - I/O exception
    • unzip

      public void unzip(IOFile target) throws IOException
      Unzips the archive to the specified directory.
      Parameters:
      target - target path
      Throws:
      IOException - I/O exception
    • zip

      public void zip(IOFile root, StringList files) throws IOException
      Zips the specified files.
      Parameters:
      root - root directory
      files - files to add
      Throws:
      IOException - I/O exception
    • progressInfo

      public double progressInfo()
      Description copied from class: Job
      Returns a progress value (0 - 1). Can be overwritten to give more specific feedback.
      Overrides:
      progressInfo in class Job
      Returns:
      header information