Package com.tccc.kos.commons.kab
Class ZipToKabCopier
java.lang.Object
com.tccc.kos.commons.kab.ZipToKabCopier
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 Summary
ConstructorsConstructorDescriptionZipToKabCopier
(File zipFile, File kabFile) Creates a reader for the zip file and a writer for the KAB file.ZipToKabCopier
(InputStream zipInput, OutputStream kabOutput) Creates a writer to copy the specified ZIP file to the destination KAB stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
copy()
Performs the copy operation.getName()
getTag()
getType()
void
setEncryptionKey
(PrivateKey privateKey) Set the encryption key used to encrypt the contents of the zip as it is written to the kab.setVersion
(String version)
-
Constructor Details
-
ZipToKabCopier
Creates a reader for the zip file and a writer for the KAB file.- Parameters:
zipFile
- the ZIP file to read fromkabFile
- the KAB file to write to- Throws:
FileNotFoundException
-
ZipToKabCopier
Creates a writer to copy the specified ZIP file to the destination KAB stream.- Parameters:
zipInput
- the ZIP input stream to read fromkabOutput
- the KAB output stream to write to
-
-
Method Details
-
setEncryptionKey
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
Performs the copy operation.- Throws:
IOException
-
getType
-
getTag
-
getName
-
getKeySet
-
getVersion
-
setType
- Returns:
this
.
-
setTag
- Returns:
this
.
-
setName
- Returns:
this
.
-
setKeySet
- Returns:
this
.
-
setVersion
- Returns:
this
.
-