Class ZipToKabCopier

java.lang.Object
com.tccc.kos.commons.kab.ZipToKabCopier

public class ZipToKabCopier extends Object
Copy the contents of a zip file to a KAB. All of the files in the zip will be copied to the KAB and any .perm files found in the zip will be used to apply permissions to the files as they are copied to the KAB.
Version:
Jun-22-22
  • Constructor Details

    • ZipToKabCopier

      public ZipToKabCopier(File zipFile, File kabFile) throws FileNotFoundException
      Creates a reader for the zip file and a writer for the KAB file.
      Parameters:
      zipFile - the ZIP file to read from
      kabFile - the KAB file to write to
      Throws:
      FileNotFoundException
    • ZipToKabCopier

      public ZipToKabCopier(InputStream zipInput, OutputStream kabOutput)
      Creates a writer to copy the specified ZIP file to the destination KAB stream.
      Parameters:
      zipInput - the ZIP input stream to read from
      kabOutput - the KAB output stream to write to
  • Method Details

    • setEncryptionKey

      public void setEncryptionKey(PrivateKey privateKey)
      Set the encryption key used to encrypt the contents of the zip as it is written to the kab. The resulting kab will require the corresponding public key to properly read the contents of the kab. Once set, all contents copied will be encrypted.
    • copy

      public void copy() throws IOException
      Performs the copy operation.
      Throws:
      IOException
    • getType

      public String getType()
    • getTag

      public String getTag()
    • getName

      public String getName()
    • getKeySet

      public KeySet getKeySet()
    • getVersion

      public String getVersion()
    • setType

      public ZipToKabCopier setType(String type)
      Returns:
      this .
    • setTag

      public ZipToKabCopier setTag(String tag)
      Returns:
      this .
    • setName

      public ZipToKabCopier setName(String name)
      Returns:
      this .
    • setKeySet

      public ZipToKabCopier setKeySet(KeySet keySet)
      Returns:
      this .
    • setVersion

      public ZipToKabCopier setVersion(String version)
      Returns:
      this .