diff --git a/README.md b/README.md index b6029f61..2ddd1c07 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ directly from the osu! program folder. Otherwise, place songs in the generated `Songs` folder or set the `BeatmapDirectory` value in the generated configuration file to the path of the root song directory. +Note that beatmaps are typically delivered as OSZ files. These can be extracted +with any ZIP tool, and opsu! will automatically extract them into the songs +folder if placed in the root directory. + ### First Run The `Music Offset` value will likely need to be adjusted when playing for the first time, or whenever hit objects are out of sync with the music. This and diff --git a/lib/zip4j/classes/net/lingala/zip4j/core/HeaderReader.class b/lib/zip4j/classes/net/lingala/zip4j/core/HeaderReader.class new file mode 100644 index 00000000..9fb93ae2 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/core/HeaderReader.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/core/HeaderWriter.class b/lib/zip4j/classes/net/lingala/zip4j/core/HeaderWriter.class new file mode 100644 index 00000000..79f17dbf Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/core/HeaderWriter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/core/ZipFile.class b/lib/zip4j/classes/net/lingala/zip4j/core/ZipFile.class new file mode 100644 index 00000000..6c2ac388 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/core/ZipFile.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/AESDecrypter.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/AESDecrypter.class new file mode 100644 index 00000000..b410290a Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/AESDecrypter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/AESEncrpyter.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/AESEncrpyter.class new file mode 100644 index 00000000..073549d6 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/AESEncrpyter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/IDecrypter.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/IDecrypter.class new file mode 100644 index 00000000..9a4773b6 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/IDecrypter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/IEncrypter.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/IEncrypter.class new file mode 100644 index 00000000..35c419ee Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/IEncrypter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/BinTools.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/BinTools.class new file mode 100644 index 00000000..43f6deea Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/BinTools.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.class new file mode 100644 index 00000000..93fd5e34 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.class new file mode 100644 index 00000000..c8318236 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2HexFormatter.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2HexFormatter.class new file mode 100644 index 00000000..1c4b7683 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2HexFormatter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.class new file mode 100644 index 00000000..18e792bc Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PRF.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PRF.class new file mode 100644 index 00000000..0c771730 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/PBKDF2/PRF.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/StandardDecrypter.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/StandardDecrypter.class new file mode 100644 index 00000000..871dd081 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/StandardDecrypter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/StandardEncrypter.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/StandardEncrypter.class new file mode 100644 index 00000000..ccb2f575 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/StandardEncrypter.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/engine/AESEngine.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/engine/AESEngine.class new file mode 100644 index 00000000..10e40c57 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/engine/AESEngine.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.class b/lib/zip4j/classes/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.class new file mode 100644 index 00000000..fbf91c20 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/exception/ZipException.class b/lib/zip4j/classes/net/lingala/zip4j/exception/ZipException.class new file mode 100644 index 00000000..491ea127 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/exception/ZipException.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/exception/ZipExceptionConstants.class b/lib/zip4j/classes/net/lingala/zip4j/exception/ZipExceptionConstants.class new file mode 100644 index 00000000..a5048c8f Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/exception/ZipExceptionConstants.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/BaseInputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/BaseInputStream.class new file mode 100644 index 00000000..dcbee645 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/BaseInputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/BaseOutputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/BaseOutputStream.class new file mode 100644 index 00000000..b1e024fb Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/BaseOutputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/CipherOutputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/CipherOutputStream.class new file mode 100644 index 00000000..d4d5f335 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/CipherOutputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/DeflaterOutputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/DeflaterOutputStream.class new file mode 100644 index 00000000..31ba521b Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/DeflaterOutputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/InflaterInputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/InflaterInputStream.class new file mode 100644 index 00000000..0927bcaa Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/InflaterInputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/PartInputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/PartInputStream.class new file mode 100644 index 00000000..54fb62d6 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/PartInputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/SplitOutputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/SplitOutputStream.class new file mode 100644 index 00000000..77bc807c Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/SplitOutputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/ZipInputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/ZipInputStream.class new file mode 100644 index 00000000..95147bb9 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/ZipInputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/io/ZipOutputStream.class b/lib/zip4j/classes/net/lingala/zip4j/io/ZipOutputStream.class new file mode 100644 index 00000000..296ec136 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/io/ZipOutputStream.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/AESExtraDataRecord.class b/lib/zip4j/classes/net/lingala/zip4j/model/AESExtraDataRecord.class new file mode 100644 index 00000000..ffcf4a21 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/AESExtraDataRecord.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/ArchiveExtraDataRecord.class b/lib/zip4j/classes/net/lingala/zip4j/model/ArchiveExtraDataRecord.class new file mode 100644 index 00000000..b831e33c Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/ArchiveExtraDataRecord.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/CentralDirectory.class b/lib/zip4j/classes/net/lingala/zip4j/model/CentralDirectory.class new file mode 100644 index 00000000..0351631d Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/CentralDirectory.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/DataDescriptor.class b/lib/zip4j/classes/net/lingala/zip4j/model/DataDescriptor.class new file mode 100644 index 00000000..bc6eabdf Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/DataDescriptor.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/DigitalSignature.class b/lib/zip4j/classes/net/lingala/zip4j/model/DigitalSignature.class new file mode 100644 index 00000000..20861e41 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/DigitalSignature.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/EndCentralDirRecord.class b/lib/zip4j/classes/net/lingala/zip4j/model/EndCentralDirRecord.class new file mode 100644 index 00000000..d1411a1e Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/EndCentralDirRecord.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/ExtraDataRecord.class b/lib/zip4j/classes/net/lingala/zip4j/model/ExtraDataRecord.class new file mode 100644 index 00000000..083c1cc1 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/ExtraDataRecord.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/FileHeader.class b/lib/zip4j/classes/net/lingala/zip4j/model/FileHeader.class new file mode 100644 index 00000000..52d439b5 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/FileHeader.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/LocalFileHeader.class b/lib/zip4j/classes/net/lingala/zip4j/model/LocalFileHeader.class new file mode 100644 index 00000000..b309498e Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/LocalFileHeader.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/UnzipEngineParameters.class b/lib/zip4j/classes/net/lingala/zip4j/model/UnzipEngineParameters.class new file mode 100644 index 00000000..3d0ef314 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/UnzipEngineParameters.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/UnzipParameters.class b/lib/zip4j/classes/net/lingala/zip4j/model/UnzipParameters.class new file mode 100644 index 00000000..e9d972b4 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/UnzipParameters.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/Zip64EndCentralDirLocator.class b/lib/zip4j/classes/net/lingala/zip4j/model/Zip64EndCentralDirLocator.class new file mode 100644 index 00000000..e25bae44 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/Zip64EndCentralDirLocator.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/Zip64EndCentralDirRecord.class b/lib/zip4j/classes/net/lingala/zip4j/model/Zip64EndCentralDirRecord.class new file mode 100644 index 00000000..6db105cb Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/Zip64EndCentralDirRecord.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/Zip64ExtendedInfo.class b/lib/zip4j/classes/net/lingala/zip4j/model/Zip64ExtendedInfo.class new file mode 100644 index 00000000..73f56333 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/Zip64ExtendedInfo.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/ZipModel.class b/lib/zip4j/classes/net/lingala/zip4j/model/ZipModel.class new file mode 100644 index 00000000..9084fca2 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/ZipModel.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/model/ZipParameters.class b/lib/zip4j/classes/net/lingala/zip4j/model/ZipParameters.class new file mode 100644 index 00000000..291415d9 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/model/ZipParameters.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/progress/ProgressMonitor.class b/lib/zip4j/classes/net/lingala/zip4j/progress/ProgressMonitor.class new file mode 100644 index 00000000..aa34c27a Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/progress/ProgressMonitor.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip$1.class b/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip$1.class new file mode 100644 index 00000000..b23d7431 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip$1.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip$2.class b/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip$2.class new file mode 100644 index 00000000..e0861b64 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip$2.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip.class b/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip.class new file mode 100644 index 00000000..6d4e99c5 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/unzip/Unzip.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/unzip/UnzipEngine.class b/lib/zip4j/classes/net/lingala/zip4j/unzip/UnzipEngine.class new file mode 100644 index 00000000..b12f75d2 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/unzip/UnzipEngine.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/unzip/UnzipUtil.class b/lib/zip4j/classes/net/lingala/zip4j/unzip/UnzipUtil.class new file mode 100644 index 00000000..8b929064 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/unzip/UnzipUtil.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer$1.class b/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer$1.class new file mode 100644 index 00000000..36422a0e Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer$1.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer$2.class b/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer$2.class new file mode 100644 index 00000000..16bcaa7b Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer$2.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer.class b/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer.class new file mode 100644 index 00000000..6d47dcc6 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/ArchiveMaintainer.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/CRCUtil.class b/lib/zip4j/classes/net/lingala/zip4j/util/CRCUtil.class new file mode 100644 index 00000000..30f1c1bb Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/CRCUtil.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/InternalZipConstants.class b/lib/zip4j/classes/net/lingala/zip4j/util/InternalZipConstants.class new file mode 100644 index 00000000..9e62dfdd Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/InternalZipConstants.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/Raw.class b/lib/zip4j/classes/net/lingala/zip4j/util/Raw.class new file mode 100644 index 00000000..e111c130 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/Raw.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/Zip4jConstants.class b/lib/zip4j/classes/net/lingala/zip4j/util/Zip4jConstants.class new file mode 100644 index 00000000..70a7def4 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/Zip4jConstants.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/util/Zip4jUtil.class b/lib/zip4j/classes/net/lingala/zip4j/util/Zip4jUtil.class new file mode 100644 index 00000000..f5a2ed61 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/util/Zip4jUtil.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/zip/ZipEngine$1.class b/lib/zip4j/classes/net/lingala/zip4j/zip/ZipEngine$1.class new file mode 100644 index 00000000..1bad3967 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/zip/ZipEngine$1.class differ diff --git a/lib/zip4j/classes/net/lingala/zip4j/zip/ZipEngine.class b/lib/zip4j/classes/net/lingala/zip4j/zip/ZipEngine.class new file mode 100644 index 00000000..cc2eb0b8 Binary files /dev/null and b/lib/zip4j/classes/net/lingala/zip4j/zip/ZipEngine.class differ diff --git a/lib/zip4j/javadoc/allclasses-frame.html b/lib/zip4j/javadoc/allclasses-frame.html new file mode 100644 index 00000000..deeede0d --- /dev/null +++ b/lib/zip4j/javadoc/allclasses-frame.html @@ -0,0 +1,134 @@ + + + + + + + +All Classes (zip4j 1.3.1 API) + + + + + + + + + + + +All Classes +
+ + + + + +
AESDecrypter +
+AESEncrpyter +
+AESEngine +
+AESExtraDataRecord +
+ArchiveExtraDataRecord +
+ArchiveMaintainer +
+BaseInputStream +
+BaseOutputStream +
+CentralDirectory +
+CipherOutputStream +
+CRCUtil +
+DataDescriptor +
+DeflaterOutputStream +
+DigitalSignature +
+EndCentralDirRecord +
+ExtraDataRecord +
+FileHeader +
+HeaderReader +
+HeaderWriter +
+IDecrypter +
+IEncrypter +
+InflaterInputStream +
+InternalZipConstants +
+LocalFileHeader +
+MacBasedPRF +
+PartInputStream +
+PBKDF2Engine +
+PBKDF2Parameters +
+ProgressMonitor +
+Raw +
+SplitOutputStream +
+StandardDecrypter +
+StandardEncrypter +
+Unzip +
+UnzipEngine +
+UnzipEngineParameters +
+UnzipParameters +
+UnzipUtil +
+Zip4jConstants +
+Zip4jUtil +
+Zip64EndCentralDirLocator +
+Zip64EndCentralDirRecord +
+Zip64ExtendedInfo +
+ZipCryptoEngine +
+ZipEngine +
+ZipException +
+ZipExceptionConstants +
+ZipFile +
+ZipInputStream +
+ZipModel +
+ZipOutputStream +
+ZipParameters +
+
+ + + diff --git a/lib/zip4j/javadoc/allclasses-noframe.html b/lib/zip4j/javadoc/allclasses-noframe.html new file mode 100644 index 00000000..df4bd120 --- /dev/null +++ b/lib/zip4j/javadoc/allclasses-noframe.html @@ -0,0 +1,134 @@ + + + + + + + +All Classes (zip4j 1.3.1 API) + + + + + + + + + + + +All Classes +
+ + + + + +
AESDecrypter +
+AESEncrpyter +
+AESEngine +
+AESExtraDataRecord +
+ArchiveExtraDataRecord +
+ArchiveMaintainer +
+BaseInputStream +
+BaseOutputStream +
+CentralDirectory +
+CipherOutputStream +
+CRCUtil +
+DataDescriptor +
+DeflaterOutputStream +
+DigitalSignature +
+EndCentralDirRecord +
+ExtraDataRecord +
+FileHeader +
+HeaderReader +
+HeaderWriter +
+IDecrypter +
+IEncrypter +
+InflaterInputStream +
+InternalZipConstants +
+LocalFileHeader +
+MacBasedPRF +
+PartInputStream +
+PBKDF2Engine +
+PBKDF2Parameters +
+ProgressMonitor +
+Raw +
+SplitOutputStream +
+StandardDecrypter +
+StandardEncrypter +
+Unzip +
+UnzipEngine +
+UnzipEngineParameters +
+UnzipParameters +
+UnzipUtil +
+Zip4jConstants +
+Zip4jUtil +
+Zip64EndCentralDirLocator +
+Zip64EndCentralDirRecord +
+Zip64ExtendedInfo +
+ZipCryptoEngine +
+ZipEngine +
+ZipException +
+ZipExceptionConstants +
+ZipFile +
+ZipInputStream +
+ZipModel +
+ZipOutputStream +
+ZipParameters +
+
+ + + diff --git a/lib/zip4j/javadoc/constant-values.html b/lib/zip4j/javadoc/constant-values.html new file mode 100644 index 00000000..815433a0 --- /dev/null +++ b/lib/zip4j/javadoc/constant-values.html @@ -0,0 +1,895 @@ + + + + + + + +Constant Field Values (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents + + + + + + +
+net.lingala.*
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
net.lingala.zip4j.exception.ZipExceptionConstants
+public static final intconstuctorFileNotFoundException2
+public static final intinputZipParamIsNull1
+public static final intnotZipFile4
+public static final intrandomAccessFileNull3
+public static final intWRONG_PASSWORD5
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
net.lingala.zip4j.progress.ProgressMonitor
+public static final intOPERATION_ADD0
+public static final intOPERATION_CALC_CRC3
+public static final intOPERATION_EXTRACT1
+public static final intOPERATION_MERGE4
+public static final intOPERATION_NONE-1
+public static final intOPERATION_REMOVE2
+public static final intRESULT_CANCELLED3
+public static final intRESULT_ERROR2
+public static final intRESULT_SUCCESS0
+public static final intRESULT_WORKING1
+public static final intSTATE_BUSY1
+public static final intSTATE_READY0
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
net.lingala.zip4j.util.InternalZipConstants
+public static final intAES_AUTH_LENGTH10
+public static final intAES_BLOCK_SIZE16
+public static final intAESSIG39169
+public static final longARCEXTDATREC134630224L
+public static final intBUFF_SIZE4096
+public static final intCENATT36
+public static final intCENATX38
+public static final intCENCOM32
+public static final intCENCRC16
+public static final intCENDSK34
+public static final intCENEXT30
+public static final intCENFLG8
+public static final intCENHDR46
+public static final intCENHOW10
+public static final intCENLEN24
+public static final intCENNAM28
+public static final intCENOFF42
+public static final longCENSIG33639248L
+public static final intCENSIZ20
+public static final intCENTIM12
+public static final intCENVEM4
+public static final intCENVER6
+public static final StringCHARSET_COMMENTS_DEFAULT"windows-1254"
+public static final StringCHARSET_CP850"Cp850"
+public static final StringCHARSET_UTF8"UTF8"
+public static final longDIGSIG84233040L
+public static final intENDCOM20
+public static final intENDHDR22
+public static final intENDOFF16
+public static final longENDSIG101010256L
+public static final intENDSIZ12
+public static final intENDSUB8
+public static final intENDTOT10
+public static final intEXTCRC4
+public static final intEXTHDR16
+public static final intEXTLEN12
+public static final intEXTRAFIELDZIP64LENGTH1
+public static final longEXTSIG134695760L
+public static final intEXTSIZ8
+public static final intFILE_MODE_ARCHIVE32
+public static final intFILE_MODE_HIDDEN2
+public static final intFILE_MODE_HIDDEN_ARCHIVE34
+public static final intFILE_MODE_NONE0
+public static final intFILE_MODE_READ_ONLY1
+public static final intFILE_MODE_READ_ONLY_ARCHIVE33
+public static final intFILE_MODE_READ_ONLY_HIDDEN3
+public static final intFILE_MODE_READ_ONLY_HIDDEN_ARCHIVE35
+public static final intFILE_MODE_SYSTEM38
+public static final intFOLDER_MODE_ARCHIVE48
+public static final intFOLDER_MODE_HIDDEN18
+public static final intFOLDER_MODE_HIDDEN_ARCHIVE50
+public static final intFOLDER_MODE_NONE16
+public static final intLIST_TYPE_FILE1
+public static final intLIST_TYPE_STRING2
+public static final intLOCCRC14
+public static final intLOCEXT28
+public static final intLOCFLG6
+public static final intLOCHDR30
+public static final intLOCHOW8
+public static final intLOCLEN22
+public static final intLOCNAM26
+public static final longLOCSIG67324752L
+public static final intLOCSIZ18
+public static final intLOCTIM10
+public static final intLOCVER4
+public static final intMAX_ALLOWED_ZIP_COMMENT_LENGTH65535
+public static final intMIN_SPLIT_LENGTH65536
+public static final intMODE_UNZIP2
+public static final intMODE_ZIP1
+public static final StringOFFSET_CENTRAL_DIR"offsetCentralDir"
+public static final StringREAD_MODE"r"
+public static final longSPLITSIG134695760L
+public static final intSTD_DEC_HDR_SIZE12
+public static final StringTHREAD_NAME"Zip4j"
+public static final intUFT8_NAMES_FLAG2048
+public static final intUPDATE_LFH_COMP_SIZE18
+public static final intUPDATE_LFH_CRC14
+public static final intUPDATE_LFH_UNCOMP_SIZE22
+public static final StringVERSION"1.3.1"
+public static final StringWRITE_MODE"rw"
+public static final longZIP_64_LIMIT4294967295L
+public static final StringZIP_FILE_SEPARATOR"/"
+public static final longZIP64ENDCENDIRLOC117853008L
+public static final longZIP64ENDCENDIRREC101075792L
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
net.lingala.zip4j.util.Zip4jConstants
+public static final intAES_STRENGTH_1281
+public static final intAES_STRENGTH_1922
+public static final intAES_STRENGTH_2563
+public static final intCOMP_AES_ENC99
+public static final intCOMP_DEFLATE8
+public static final intCOMP_STORE0
+public static final intDEFLATE_LEVEL_FAST3
+public static final intDEFLATE_LEVEL_FASTEST1
+public static final intDEFLATE_LEVEL_MAXIMUM7
+public static final intDEFLATE_LEVEL_NORMAL5
+public static final intDEFLATE_LEVEL_ULTRA9
+public static final intENC_METHOD_AES99
+public static final intENC_METHOD_STANDARD0
+public static final intENC_NO_ENCRYPTION-1
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/deprecated-list.html b/lib/zip4j/javadoc/deprecated-list.html new file mode 100644 index 00000000..bf9cdfa9 --- /dev/null +++ b/lib/zip4j/javadoc/deprecated-list.html @@ -0,0 +1,147 @@ + + + + + + + +Deprecated List (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+Contents + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/help-doc.html b/lib/zip4j/javadoc/help-doc.html new file mode 100644 index 00000000..edf7b226 --- /dev/null +++ b/lib/zip4j/javadoc/help-doc.html @@ -0,0 +1,224 @@ + + + + + + + +API Help (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Overview

+
+ +

+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

+

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+ +

+Annotation Type

+
+ +

+Each annotation type has its own separate page with the following sections:

+
+ +

+Enum

+
+ +

+Each enum has its own separate page with the following sections:

+
+

+Use

+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object. +
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+

+Constant Field Values

+The Constant Field Values page lists the static final fields and their values. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/index-all.html b/lib/zip4j/javadoc/index-all.html new file mode 100644 index 00000000..ea3e2e52 --- /dev/null +++ b/lib/zip4j/javadoc/index-all.html @@ -0,0 +1,2540 @@ + + + + + + + +Index (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +A B C D E F G H I J L M N O P R S T U V W X Z _
+

+A

+
+
addFile(File, ZipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Adds input source file to the zip file. +
addFiles(ArrayList, ZipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Adds the list of input files to the zip file. +
addFiles(ArrayList, ZipParameters, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.zip.ZipEngine +
  +
addFolder(String, ZipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Adds the folder in the given path to the zip file. +
addFolder(File, ZipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Adds the folder in the given file object to the zip file. +
addFolderToZip(File, ZipParameters, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.zip.ZipEngine +
  +
addStream(InputStream, ZipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Creates a new entry in the zip file and adds the content of the inputstream to the + zip file. +
addStreamToZip(InputStream, ZipParameters) - +Method in class net.lingala.zip4j.zip.ZipEngine +
  +
AES_AUTH_LENGTH - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
AES_BLOCK_SIZE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
AES_STRENGTH_128 - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
AES_STRENGTH_192 - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
AES_STRENGTH_256 - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
AESDecrypter - Class in net.lingala.zip4j.crypto
 
AESDecrypter(LocalFileHeader, byte[], byte[]) - +Constructor for class net.lingala.zip4j.crypto.AESDecrypter +
  +
AESEncrpyter - Class in net.lingala.zip4j.crypto
 
AESEncrpyter(char[], int) - +Constructor for class net.lingala.zip4j.crypto.AESEncrpyter +
  +
AESEngine - Class in net.lingala.zip4j.crypto.engine
Core Engine for AES Encryption
AESEngine(byte[]) - +Constructor for class net.lingala.zip4j.crypto.engine.AESEngine +
  +
AESExtraDataRecord - Class in net.lingala.zip4j.model
 
AESExtraDataRecord() - +Constructor for class net.lingala.zip4j.model.AESExtraDataRecord +
  +
AESSIG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
applyFileAttributes(FileHeader, File) - +Static method in class net.lingala.zip4j.unzip.UnzipUtil +
  +
applyFileAttributes(FileHeader, File, UnzipParameters) - +Static method in class net.lingala.zip4j.unzip.UnzipUtil +
  +
ARCEXTDATREC - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ArchiveExtraDataRecord - Class in net.lingala.zip4j.model
 
ArchiveExtraDataRecord() - +Constructor for class net.lingala.zip4j.model.ArchiveExtraDataRecord +
  +
ArchiveMaintainer - Class in net.lingala.zip4j.util
 
ArchiveMaintainer() - +Constructor for class net.lingala.zip4j.util.ArchiveMaintainer +
  +
assertPRF(byte[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
available() - +Method in class net.lingala.zip4j.io.BaseInputStream +
  +
available() - +Method in class net.lingala.zip4j.io.InflaterInputStream +
Returns 0 after EOF has been reached, otherwise always return 1. +
available() - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
available() - +Method in class net.lingala.zip4j.io.ZipInputStream +
  +
+
+

+B

+
+
BaseInputStream - Class in net.lingala.zip4j.io
 
BaseInputStream() - +Constructor for class net.lingala.zip4j.io.BaseInputStream +
  +
BaseOutputStream - Class in net.lingala.zip4j.io
 
BaseOutputStream() - +Constructor for class net.lingala.zip4j.io.BaseOutputStream +
  +
bitArrayToByte(int[]) - +Static method in class net.lingala.zip4j.util.Raw +
  +
BUFF_SIZE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
+
+

+C

+
+
cancelAllTasks() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
ceil(int, int) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
CENATT - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENATX - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENCOM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENCRC - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENDSK - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENEXT - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENFLG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENHDR - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENHOW - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENLEN - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENNAM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENOFF - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENSIG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENSIZ - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENTIM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CentralDirectory - Class in net.lingala.zip4j.model
 
CentralDirectory() - +Constructor for class net.lingala.zip4j.model.CentralDirectory +
  +
CENVEM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CENVER - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CHARSET_COMMENTS_DEFAULT - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CHARSET_CP850 - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CHARSET_DEFAULT - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
CHARSET_UTF8 - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
checkArrayListTypes(ArrayList, int) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Checks to see if all the elements in the arraylist match the given type +
checkBuffSizeAndStartNextSplitFile(int) - +Method in class net.lingala.zip4j.io.SplitOutputStream +
Checks if the buffer size is sufficient for the current split file. +
checkCRC() - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
checkFileExists(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
checkFileExists(File) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
checkFileReadAccess(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
checkFileWriteAccess(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
checkOutputFolder(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
CipherOutputStream - Class in net.lingala.zip4j.io
 
CipherOutputStream(OutputStream, ZipModel) - +Constructor for class net.lingala.zip4j.io.CipherOutputStream +
  +
clone() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
clone() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
close() - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
close() - +Method in class net.lingala.zip4j.io.InflaterInputStream +
  +
close() - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
close() - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
close() - +Method in class net.lingala.zip4j.io.ZipInputStream +
Closes the input stream and releases any resources. +
close(boolean) - +Method in class net.lingala.zip4j.io.ZipInputStream +
Closes the input stream and releases any resources. +
closeEntry() - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
closeEntry() - +Method in class net.lingala.zip4j.io.DeflaterOutputStream +
  +
COMP_AES_ENC - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
COMP_DEFLATE - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
COMP_STORE - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
computeFileCRC(String) - +Static method in class net.lingala.zip4j.util.CRCUtil +
  +
computeFileCRC(String, ProgressMonitor) - +Static method in class net.lingala.zip4j.util.CRCUtil +
Calculates CRC of a file +
constuctorFileNotFoundException - +Static variable in interface net.lingala.zip4j.exception.ZipExceptionConstants +
  +
convertCharArrayToByteArray(char[]) - +Static method in class net.lingala.zip4j.util.Raw +
Converts a char array to byte array +
convertCharset(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
crc - +Variable in class net.lingala.zip4j.io.CipherOutputStream +
  +
CRCUtil - Class in net.lingala.zip4j.util
 
CRCUtil() - +Constructor for class net.lingala.zip4j.util.CRCUtil +
  +
createZipFile(File, ZipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Creates a zip file and adds the source file to the zip file. +
createZipFile(File, ZipParameters, boolean, long) - +Method in class net.lingala.zip4j.core.ZipFile +
Creates a zip file and adds the source file to the zip file. +
createZipFile(ArrayList, ZipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Creates a zip file and adds the list of source file(s) to the zip file. +
createZipFile(ArrayList, ZipParameters, boolean, long) - +Method in class net.lingala.zip4j.core.ZipFile +
Creates a zip file and adds the list of source file(s) to the zip file. +
createZipFileFromFolder(String, ZipParameters, boolean, long) - +Method in class net.lingala.zip4j.core.ZipFile +
Creates a zip file and adds the files/folders from the specified folder to the zip file. +
createZipFileFromFolder(File, ZipParameters, boolean, long) - +Method in class net.lingala.zip4j.core.ZipFile +
Creates a zip file and adds the files/folders from the specified folder to the zip file. +
+
+

+D

+
+
DataDescriptor - Class in net.lingala.zip4j.model
 
DataDescriptor() - +Constructor for class net.lingala.zip4j.model.DataDescriptor +
  +
decodeFileName(byte[], boolean) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Decodes file name based on encoding. +
decrementCompressedFileSize(int) - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
decryptByte() - +Method in class net.lingala.zip4j.crypto.engine.ZipCryptoEngine +
  +
decryptData(byte[], int, int) - +Method in class net.lingala.zip4j.crypto.AESDecrypter +
  +
decryptData(byte[]) - +Method in class net.lingala.zip4j.crypto.AESDecrypter +
  +
decryptData(byte[], int, int) - +Method in interface net.lingala.zip4j.crypto.IDecrypter +
  +
decryptData(byte[]) - +Method in interface net.lingala.zip4j.crypto.IDecrypter +
  +
decryptData(byte[]) - +Method in class net.lingala.zip4j.crypto.StandardDecrypter +
  +
decryptData(byte[], int, int) - +Method in class net.lingala.zip4j.crypto.StandardDecrypter +
  +
DEFLATE_LEVEL_FAST - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
DEFLATE_LEVEL_FASTEST - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
DEFLATE_LEVEL_MAXIMUM - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
DEFLATE_LEVEL_NORMAL - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
DEFLATE_LEVEL_ULTRA - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
deflater - +Variable in class net.lingala.zip4j.io.DeflaterOutputStream +
  +
DeflaterOutputStream - Class in net.lingala.zip4j.io
 
DeflaterOutputStream(OutputStream, ZipModel) - +Constructor for class net.lingala.zip4j.io.DeflaterOutputStream +
  +
derivedKey - +Variable in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
deriveKey(char[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
deriveKey(char[], int) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
detectCharSet(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Detects the encoding charset for the input string +
DigitalSignature - Class in net.lingala.zip4j.model
 
DigitalSignature() - +Constructor for class net.lingala.zip4j.model.DigitalSignature +
  +
DIGSIG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
doFinal(byte[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
doFinal() - +Method in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
dosToJavaTme(int) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Converts time in dos format to Java format +
+
+

+E

+
+
ENC_METHOD_AES - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
ENC_METHOD_STANDARD - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
ENC_NO_ENCRYPTION - +Static variable in interface net.lingala.zip4j.util.Zip4jConstants +
  +
encryptByte(byte) - +Method in class net.lingala.zip4j.crypto.StandardEncrypter +
  +
encryptData(byte[]) - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
encryptData(byte[], int, int) - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
encryptData(byte[]) - +Method in interface net.lingala.zip4j.crypto.IEncrypter +
  +
encryptData(byte[], int, int) - +Method in interface net.lingala.zip4j.crypto.IEncrypter +
  +
encryptData(byte[]) - +Method in class net.lingala.zip4j.crypto.StandardEncrypter +
  +
encryptData(byte[], int, int) - +Method in class net.lingala.zip4j.crypto.StandardEncrypter +
  +
EndCentralDirRecord - Class in net.lingala.zip4j.model
 
EndCentralDirRecord() - +Constructor for class net.lingala.zip4j.model.EndCentralDirRecord +
  +
ENDCOM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ENDHDR - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ENDOFF - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
endProgressMonitorError(Throwable) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
endProgressMonitorSuccess() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
ENDSIG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ENDSIZ - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ENDSUB - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ENDTOT - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
EXTCRC - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
EXTHDR - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
EXTLEN - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
extractAll(String) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts all the files in the given zip file to the input destination path. +
extractAll(String, UnzipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts all the files in the given zip file to the input destination path. +
extractAll(UnzipParameters, String, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.unzip.Unzip +
  +
extractFile(FileHeader, String) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts a specific file from the zip file to the destination path. +
extractFile(FileHeader, String, UnzipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts a specific file from the zip file to the destination path. +
extractFile(FileHeader, String, UnzipParameters, String) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts a specific file from the zip file to the destination path. +
extractFile(String, String) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts a specific file from the zip file to the destination path. +
extractFile(String, String, UnzipParameters) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts a specific file from the zip file to the destination path. +
extractFile(String, String, UnzipParameters, String) - +Method in class net.lingala.zip4j.core.ZipFile +
Extracts a specific file from the zip file to the destination path. +
extractFile(ZipModel, String, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.model.FileHeader +
Extracts file to the specified directory +
extractFile(ZipModel, String, UnzipParameters, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.model.FileHeader +
Extracts file to the specified directory using any + user defined parameters in UnzipParameters +
extractFile(ZipModel, String, UnzipParameters, String, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.model.FileHeader +
Extracts file to the specified directory using any + user defined parameters in UnzipParameters. +
extractFile(FileHeader, String, UnzipParameters, String, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.unzip.Unzip +
  +
ExtraDataRecord - Class in net.lingala.zip4j.model
 
ExtraDataRecord() - +Constructor for class net.lingala.zip4j.model.ExtraDataRecord +
  +
EXTRAFIELDZIP64LENGTH - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
EXTSIG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
EXTSIZ - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
+
+

+F

+
+
FILE_MODE_ARCHIVE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_HIDDEN - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_HIDDEN_ARCHIVE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_NONE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_READ_ONLY - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_READ_ONLY_ARCHIVE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_READ_ONLY_HIDDEN - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_READ_ONLY_HIDDEN_ARCHIVE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_MODE_SYSTEM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FILE_SEPARATOR - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
fileHeader - +Variable in class net.lingala.zip4j.io.CipherOutputStream +
  +
FileHeader - Class in net.lingala.zip4j.model
 
FileHeader() - +Constructor for class net.lingala.zip4j.model.FileHeader +
  +
finalizeZipFile(ZipModel, OutputStream) - +Method in class net.lingala.zip4j.core.HeaderWriter +
Processes zip header data and writes this data to the zip file +
finalizeZipFileWithoutValidations(ZipModel, OutputStream) - +Method in class net.lingala.zip4j.core.HeaderWriter +
Processes zip header data and writes this data to the zip file without any validations. +
finish() - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
finish() - +Method in class net.lingala.zip4j.io.DeflaterOutputStream +
  +
flush() - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
FOLDER_MODE_ARCHIVE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FOLDER_MODE_HIDDEN - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FOLDER_MODE_HIDDEN_ARCHIVE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
FOLDER_MODE_NONE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
fullReset() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
+
+

+G

+
+
generateRandomBytes(int) - +Method in class net.lingala.zip4j.crypto.StandardEncrypter +
  +
getAbsoluteFilePath(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Returns an absoulte path for the given file path +
getAesExtraDataRecord() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getAesExtraDataRecord() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getAesKeyStrength() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getAesStrength() - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
getAllHeaderSignatures() - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getArchiveExtraDataRecord() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getCalculatedAuthenticationBytes() - +Method in class net.lingala.zip4j.crypto.AESDecrypter +
  +
getCentralDirectory() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getCode() - +Method in exception net.lingala.zip4j.exception.ZipException +
  +
getComment() - +Method in class net.lingala.zip4j.core.ZipFile +
Returns the comment set for the Zip file +
getComment(String) - +Method in class net.lingala.zip4j.core.ZipFile +
Returns the comment set for the Zip file in the input encoding +
getComment() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getCommentBytes() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getCommentLength() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getCompressedSize() - +Method in class net.lingala.zip4j.model.DataDescriptor +
  +
getCompressedSize() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getCompressedSize() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getCompressedSize() - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
getCompressionLevel() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getCompressionMethod() - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
getCompressionMethod() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getCompressionMethod() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getCompressionMethod() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getCp850EncodedString(byte[]) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Returns a string in Cp850 encoding from the input bytes. +
getCrc32() - +Method in class net.lingala.zip4j.model.DataDescriptor +
  +
getCrc32() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getCrc32() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getCrcBuff() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getCrcBuff() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getCurrentOperation() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getCurrSplitFileCounter() - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
getData() - +Method in class net.lingala.zip4j.model.ExtraDataRecord +
  +
getDataDescriptorList() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getDataSize() - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
getDecrypter() - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
getDefaultFolderPath() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getDerivedKey() - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
getDerivedPasswordVerifier() - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
getDigitalSignature() - +Method in class net.lingala.zip4j.model.CentralDirectory +
  +
getDiskNumberStart() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getDiskNumberStart() - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
getEncodedStringLength(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
returns the length of the string by wrapping it in a byte buffer with + the appropriate charset of the input string and returns the limit of the + byte buffer +
getEncodedStringLength(String, String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
returns the length of the string in the input encoding +
getEncryptionMethod() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getEncryptionMethod() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getEncryptionMethod() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getEnd() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getEndCentralDirRecord() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getException() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getExtensibleDataSector() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getExternalFileAttr() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getExtraDataRecords() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getExtraDataRecords() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getExtraField() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getExtraFieldData() - +Method in class net.lingala.zip4j.model.ArchiveExtraDataRecord +
  +
getExtraFieldLength() - +Method in class net.lingala.zip4j.model.ArchiveExtraDataRecord +
  +
getExtraFieldLength() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getExtraFieldLength() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getFile() - +Method in class net.lingala.zip4j.core.ZipFile +
Returns the File object of the zip file +
getFileComment() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getFileCommentLength() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getFileHeader(String) - +Method in class net.lingala.zip4j.core.ZipFile +
Returns FileHeader if a file header with the given fileHeader + string exists in the zip model: If not returns null +
getFileHeader() - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
getFileHeader() - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
getFileHeader(ZipModel, String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getFileHeaders() - +Method in class net.lingala.zip4j.core.ZipFile +
Returns the list of file headers in the zip file. +
getFileHeaders() - +Method in class net.lingala.zip4j.model.CentralDirectory +
  +
getFileHeaderWithExactMatch(ZipModel, String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getFileLengh(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getFileLengh(File) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getFileName() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getFileName() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getFileName() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getFileNameCharset() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getFileNameFromFilePath(File) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getFileNameInZip() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getFileNameLength() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getFileNameLength() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getFilePointer() - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
getFilesInDirectoryRec(File, boolean) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getFinalMac() - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
getGeneralPurposeFlag() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getGeneralPurposeFlag() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getHashAlgorithm() - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
getHashCharset() - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
getHeader() - +Method in class net.lingala.zip4j.model.ExtraDataRecord +
  +
getHeader() - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
getHeaderBytes() - +Method in class net.lingala.zip4j.crypto.StandardEncrypter +
  +
getHeaderSignature() - +Method in class net.lingala.zip4j.model.DigitalSignature +
  +
getHLen() - +Method in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
getIDecryptor() - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
getIndexOfFileHeader(ZipModel, FileHeader) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getInputStream(FileHeader) - +Method in class net.lingala.zip4j.core.ZipFile +
Returns an input stream for reading the contents of the Zip file corresponding + to the input FileHeader. +
getInputStream(FileHeader) - +Method in class net.lingala.zip4j.unzip.Unzip +
  +
getInputStream() - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
getInternalFileAttr() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getIterationCount() - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
getLastModFileTime() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getLastModFileTime() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getLastModifiedFileTime(File, TimeZone) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getLocalFileHeader() - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
getLocalFileHeader() - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
getLocalFileHeaderList() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getNoOfDiskStartOfZip64EndOfCentralDirRec() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
getNoOfThisDisk() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getNoOfThisDisk() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getNoOfThisDiskStartOfCentralDir() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getNoOfThisDiskStartOfCentralDir() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getOffsetLocalHeader() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getOffsetLocalHeader() - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
getOffsetOfStartOfCentralDir() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getOffsetStartCenDirWRTStartDiskNo() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getOffsetStartOfData() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getOffsetZip64EndOfCentralDirRec() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
getOutputStream() - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
getParameters() - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
getPassword() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getPassword() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getPassword() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getPasswordVerifierLength() - +Method in class net.lingala.zip4j.crypto.AESDecrypter +
  +
getPasswordVeriifierLength() - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
getPercentDone() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getProgressMonitor() - +Method in class net.lingala.zip4j.core.ZipFile +
  +
getPseudoRandomFunction() - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
getRelativeFileName(String, String, String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getResult() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getRootFolderInZip() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getSalt() - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
getSaltBytes() - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
getSaltLength() - +Method in class net.lingala.zip4j.crypto.AESDecrypter +
  +
getSaltLength() - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
getSignature() - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
getSignature() - +Method in class net.lingala.zip4j.model.ArchiveExtraDataRecord +
  +
getSignature() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getSignature() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getSignature() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getSignature() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
getSignature() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getSignatureData() - +Method in class net.lingala.zip4j.model.DigitalSignature +
  +
getSize() - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
getSizeOfCentralDir() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getSizeOfCentralDir() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getSizeOfData() - +Method in class net.lingala.zip4j.model.DigitalSignature +
  +
getSizeOfData() - +Method in class net.lingala.zip4j.model.ExtraDataRecord +
  +
getSizeOfZip64EndCentralDirRec() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getSourceFile() - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
getSourceFileCRC() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getSplitLength() - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
getSplitLength() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getSplitZipFiles() - +Method in class net.lingala.zip4j.core.ZipFile +
Returns the full file path+names of all split zip files + in an ArrayList. +
getSplitZipFiles(ZipModel) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getStart() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getState() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getStoredMac() - +Method in class net.lingala.zip4j.crypto.AESDecrypter +
  +
getTimeZone() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
getTotalWork() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getTotNoOfEntriesInCentralDir() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getTotNoOfEntriesInCentralDir() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getTotNoOfEntriesInCentralDirOnThisDisk() - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
getTotNoOfEntriesInCentralDirOnThisDisk() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getTotNumberOfDiscs() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
getUncompressedSize() - +Method in class net.lingala.zip4j.model.DataDescriptor +
  +
getUncompressedSize() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getUncompressedSize() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getUnCompressedSize() - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
getUnzipEngine() - +Method in class net.lingala.zip4j.io.BaseInputStream +
  +
getUnzipEngine() - +Method in class net.lingala.zip4j.io.InflaterInputStream +
  +
getUnzipEngine() - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
getUnzipEngine() - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
getVendorID() - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
getVersionMadeBy() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getVersionMadeBy() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getVersionNeededToExtract() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getVersionNeededToExtract() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getVersionNeededToExtract() - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
getVersionNumber() - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
getWorkCompleted() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
getZip64EndCentralDirLocator() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getZip64EndCentralDirRecord() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getZip64ExtendedInfo() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
getZip64ExtendedInfo() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
getZipFile() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
getZipFileNameWithoutExt(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
getZipModel() - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
getZipModel() - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
+
+

+H

+
+
hashAlgorithm - +Variable in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
hashCharset - +Variable in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
HeaderReader - Class in net.lingala.zip4j.core
Helper class to read header information for the zip file
HeaderReader(RandomAccessFile) - +Constructor for class net.lingala.zip4j.core.HeaderReader +
Creates a new HeaderReader object with the given input stream +
HeaderWriter - Class in net.lingala.zip4j.core
 
HeaderWriter() - +Constructor for class net.lingala.zip4j.core.HeaderWriter +
  +
hLen - +Variable in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
+
+

+I

+
+
IDecrypter - Interface in net.lingala.zip4j.crypto
 
IEncrypter - Interface in net.lingala.zip4j.crypto
 
InflaterInputStream - Class in net.lingala.zip4j.io
 
InflaterInputStream(RandomAccessFile, long, long, UnzipEngine) - +Constructor for class net.lingala.zip4j.io.InflaterInputStream +
  +
init(byte[]) - +Method in class net.lingala.zip4j.crypto.engine.AESEngine +
  +
init(byte[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
init(byte[]) - +Method in class net.lingala.zip4j.crypto.StandardDecrypter +
  +
initKeys(char[]) - +Method in class net.lingala.zip4j.crypto.engine.ZipCryptoEngine +
  +
initProgressMonitorForMergeOp(ZipModel, ProgressMonitor) - +Method in class net.lingala.zip4j.util.ArchiveMaintainer +
  +
initProgressMonitorForRemoveOp(ZipModel, FileHeader, ProgressMonitor) - +Method in class net.lingala.zip4j.util.ArchiveMaintainer +
  +
initRemoveZipFile(ZipModel, FileHeader, ProgressMonitor) - +Method in class net.lingala.zip4j.util.ArchiveMaintainer +
  +
inputZipParamIsNull - +Static variable in interface net.lingala.zip4j.exception.ZipExceptionConstants +
  +
INT(byte[], int, int) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
InternalZipConstants - Interface in net.lingala.zip4j.util
 
isBuffSizeFitForCurrSplitFile(int) - +Method in class net.lingala.zip4j.io.SplitOutputStream +
Checks if the given buffer size will be fit in the current split file. +
isCancelAllTasks() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
isDataDescriptorExists() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
isDataDescriptorExists() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
isDirectory() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
isEncrypted() - +Method in class net.lingala.zip4j.core.ZipFile +
Checks to see if the zip file is encrypted +
isEncrypted() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
isEncrypted() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
isEncryptFiles() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
isFileNameUTF8Encoded() - +Method in class net.lingala.zip4j.model.FileHeader +
  +
isFileNameUTF8Encoded() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
isIgnoreAllFileAttributes() - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
isIgnoreArchiveFileAttribute() - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
isIgnoreDateTimeAttributes() - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
isIgnoreHiddenFileAttribute() - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
isIgnoreReadOnlyFileAttribute() - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
isIgnoreSystemFileAttribute() - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
isIncludeRootFolder() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
isNestedZipFile() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
isPause() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
isReadHiddenFiles() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
isRunInThread() - +Method in class net.lingala.zip4j.core.ZipFile +
  +
isSourceExternalStream() - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
isSplitArchive() - +Method in class net.lingala.zip4j.core.ZipFile +
Checks if the zip file is a split archive +
isSplitArchive() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
isSplitZipFile() - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
isStringNotNullAndNotEmpty(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
isSupportedCharset(String) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Checks if the input charset is supported +
isValidZipFile() - +Method in class net.lingala.zip4j.core.ZipFile +
Checks to see if the input zip file is a valid zip file. +
isWindows() - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
isWriteComprSizeInZip64ExtraRecord() - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
isZip64Format() - +Method in class net.lingala.zip4j.model.ZipModel +
  +
iterationCount - +Variable in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
+
+

+J

+
+
javaToDosTime(long) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
Converts input time from Java to DOS format +
+
+

+L

+
+
LIST_TYPE_FILE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LIST_TYPE_STRING - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
localFileHeader - +Variable in class net.lingala.zip4j.io.CipherOutputStream +
  +
LocalFileHeader - Class in net.lingala.zip4j.model
 
LocalFileHeader() - +Constructor for class net.lingala.zip4j.model.LocalFileHeader +
  +
LOCCRC - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCEXT - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCFLG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCHDR - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCHOW - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCLEN - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCNAM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCSIG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCSIZ - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCTIM - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
LOCVER - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
+
+

+M

+
+
mac - +Variable in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
macAlgorithm - +Variable in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
MacBasedPRF - Class in net.lingala.zip4j.crypto.PBKDF2
 
MacBasedPRF(String) - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
MacBasedPRF(String, String) - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
MAX_ALLOWED_ZIP_COMMENT_LENGTH - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
mergeSplitFiles(File) - +Method in class net.lingala.zip4j.core.ZipFile +
Merges split zip files into a single zip file without the need to extract the + files in the archive +
mergeSplitZipFiles(ZipModel, File, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.util.ArchiveMaintainer +
Merges split Zip files into a single Zip file +
MIN_SPLIT_LENGTH - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
MODE_UNZIP - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
MODE_ZIP - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
+
+

+N

+
+
net.lingala.zip4j.core - package net.lingala.zip4j.core
 
net.lingala.zip4j.crypto - package net.lingala.zip4j.crypto
 
net.lingala.zip4j.crypto.engine - package net.lingala.zip4j.crypto.engine
 
net.lingala.zip4j.crypto.PBKDF2 - package net.lingala.zip4j.crypto.PBKDF2
 
net.lingala.zip4j.exception - package net.lingala.zip4j.exception
 
net.lingala.zip4j.io - package net.lingala.zip4j.io
 
net.lingala.zip4j.model - package net.lingala.zip4j.model
 
net.lingala.zip4j.progress - package net.lingala.zip4j.progress
 
net.lingala.zip4j.unzip - package net.lingala.zip4j.unzip
 
net.lingala.zip4j.util - package net.lingala.zip4j.util
 
net.lingala.zip4j.zip - package net.lingala.zip4j.zip
 
notZipFile - +Static variable in interface net.lingala.zip4j.exception.ZipExceptionConstants +
  +
+
+

+O

+
+
OFFSET_CENTRAL_DIR - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
OPERATION_ADD - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
OPERATION_CALC_CRC - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
OPERATION_EXTRACT - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
OPERATION_MERGE - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
OPERATION_NONE - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
OPERATION_REMOVE - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
outputStream - +Variable in class net.lingala.zip4j.io.CipherOutputStream +
  +
+
+

+P

+
+
parameters - +Variable in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
PartInputStream - Class in net.lingala.zip4j.io
 
PartInputStream(RandomAccessFile, long, long, UnzipEngine) - +Constructor for class net.lingala.zip4j.io.PartInputStream +
  +
PBKDF2(PRF, byte[], int, int) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
PBKDF2Engine - Class in net.lingala.zip4j.crypto.PBKDF2
 
PBKDF2Engine() - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
PBKDF2Engine(PBKDF2Parameters) - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
PBKDF2Engine(PBKDF2Parameters, PRF) - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
PBKDF2Parameters - Class in net.lingala.zip4j.crypto.PBKDF2
 
PBKDF2Parameters() - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
PBKDF2Parameters(String, String, byte[], int) - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
PBKDF2Parameters(String, String, byte[], int, byte[]) - +Constructor for class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
prepareBuffAESIVBytes(byte[], int, int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
prf - +Variable in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
processBlock(byte[], byte[]) - +Method in class net.lingala.zip4j.crypto.engine.AESEngine +
  +
processBlock(byte[], int, byte[], int) - +Method in class net.lingala.zip4j.crypto.engine.AESEngine +
  +
ProgressMonitor - Class in net.lingala.zip4j.progress
If Zip4j is set to run in thread mode, this class helps retrieve current progress
ProgressMonitor() - +Constructor for class net.lingala.zip4j.progress.ProgressMonitor +
  +
putNextEntry(File, ZipParameters) - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
putNextEntry(File, ZipParameters) - +Method in class net.lingala.zip4j.io.DeflaterOutputStream +
  +
+
+

+R

+
+
randomAccessFileNull - +Static variable in interface net.lingala.zip4j.exception.ZipExceptionConstants +
  +
Raw - Class in net.lingala.zip4j.util
 
Raw() - +Constructor for class net.lingala.zip4j.util.Raw +
  +
read() - +Method in class net.lingala.zip4j.io.BaseInputStream +
  +
read() - +Method in class net.lingala.zip4j.io.InflaterInputStream +
  +
read(byte[]) - +Method in class net.lingala.zip4j.io.InflaterInputStream +
  +
read(byte[], int, int) - +Method in class net.lingala.zip4j.io.InflaterInputStream +
  +
read() - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
read(byte[]) - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
read(byte[], int, int) - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
read() - +Method in class net.lingala.zip4j.io.ZipInputStream +
  +
read(byte[]) - +Method in class net.lingala.zip4j.io.ZipInputStream +
  +
read(byte[], int, int) - +Method in class net.lingala.zip4j.io.ZipInputStream +
  +
READ_MODE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
readAllHeaders() - +Method in class net.lingala.zip4j.core.HeaderReader +
Reads all the header information for the zip file. +
readAllHeaders(String) - +Method in class net.lingala.zip4j.core.HeaderReader +
Reads all the header information for the zip file. +
readIntLittleEndian(byte[], int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
readLeInt(DataInput, byte[]) - +Static method in class net.lingala.zip4j.util.Raw +
  +
readLocalFileHeader(FileHeader) - +Method in class net.lingala.zip4j.core.HeaderReader +
Reads local file header for the given file header +
readLongLittleEndian(byte[], int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
readShortBigEndian(byte[], int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
readShortLittleEndian(byte[], int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
removeFile(String) - +Method in class net.lingala.zip4j.core.ZipFile +
Removes the file provided in the input paramters from the zip file. +
removeFile(FileHeader) - +Method in class net.lingala.zip4j.core.ZipFile +
Removes the file provided in the input file header from the zip file. +
removeZipFile(ZipModel, FileHeader, ProgressMonitor, boolean) - +Method in class net.lingala.zip4j.util.ArchiveMaintainer +
  +
reset() - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
RESULT_CANCELLED - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
RESULT_ERROR - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
RESULT_SUCCESS - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
RESULT_WORKING - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
+
+

+S

+
+
salt - +Variable in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
seek(long) - +Method in class net.lingala.zip4j.io.BaseInputStream +
  +
seek(long) - +Method in class net.lingala.zip4j.io.InflaterInputStream +
  +
seek(long) - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
seek(long) - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
setAesExtraDataRecord(AESExtraDataRecord) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setAesExtraDataRecord(AESExtraDataRecord) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setAesKeyStrength(int) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setAesStrength(int) - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
setArchiveExtraDataRecord(ArchiveExtraDataRecord) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setCentralDirectory(CentralDirectory) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setComment(String) - +Method in class net.lingala.zip4j.core.ZipFile +
Sets comment for the Zip file +
setComment(String) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setComment(ZipModel, String) - +Method in class net.lingala.zip4j.util.ArchiveMaintainer +
  +
setCommentBytes(byte[]) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setCommentLength(int) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setCompressedSize(int) - +Method in class net.lingala.zip4j.model.DataDescriptor +
  +
setCompressedSize(long) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setCompressedSize(long) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setCompressedSize(long) - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
setCompressionLevel(int) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setCompressionMethod(int) - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
setCompressionMethod(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setCompressionMethod(int) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setCompressionMethod(int) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setCrc32(String) - +Method in class net.lingala.zip4j.model.DataDescriptor +
  +
setCrc32(long) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setCrc32(long) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setCrcBuff(byte[]) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setCrcBuff(byte[]) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setCurrentOperation(int) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setData(byte[]) - +Method in class net.lingala.zip4j.model.ExtraDataRecord +
  +
setDataDescriptorExists(boolean) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setDataDescriptorExists(boolean) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setDataDescriptorList(List) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setDataSize(int) - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
setDefaultFolderPath(String) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setDerivedKey(byte[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
setDerivedPasswordVerifier(byte[]) - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
setDigitalSignature(DigitalSignature) - +Method in class net.lingala.zip4j.model.CentralDirectory +
  +
setDirectory(boolean) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setDiskNumberStart(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setDiskNumberStart(int) - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
setEncrypted(boolean) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setEncrypted(boolean) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setEncryptFiles(boolean) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setEncryptionMethod(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setEncryptionMethod(int) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setEncryptionMethod(int) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setEnd(long) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setEndCentralDirRecord(EndCentralDirRecord) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setException(Throwable) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setExtensibleDataSector(byte[]) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setExternalFileAttr(byte[]) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setExtraDataRecords(ArrayList) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setExtraDataRecords(ArrayList) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setExtraField(byte[]) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setExtraFieldData(String) - +Method in class net.lingala.zip4j.model.ArchiveExtraDataRecord +
  +
setExtraFieldLength(int) - +Method in class net.lingala.zip4j.model.ArchiveExtraDataRecord +
  +
setExtraFieldLength(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setExtraFieldLength(int) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setFileArchive(File) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
setFileComment(String) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setFileCommentLength(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setFileHeader(FileHeader) - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
setFileHeaders(ArrayList) - +Method in class net.lingala.zip4j.model.CentralDirectory +
  +
setFileHidden(File) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
setFileName(String) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setFileName(String) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setFileName(String) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setFileNameCharset(String) - +Method in class net.lingala.zip4j.core.ZipFile +
Zip4j will encode all the file names with the input charset. +
setFileNameCharset(String) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setFileNameInZip(String) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setFileNameLength(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setFileNameLength(int) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setFileNameUTF8Encoded(boolean) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setFileNameUTF8Encoded(boolean) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setFileReadOnly(File) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
setFileSystemMode(File) - +Static method in class net.lingala.zip4j.util.Zip4jUtil +
  +
setGeneralPurposeFlag(byte[]) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setGeneralPurposeFlag(byte[]) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setHashAlgorithm(String) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
setHashCharset(String) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
setHeader(long) - +Method in class net.lingala.zip4j.model.ExtraDataRecord +
  +
setHeader(int) - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
setHeaderSignature(int) - +Method in class net.lingala.zip4j.model.DigitalSignature +
  +
setIDecryptor(IDecrypter) - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
setIgnoreAllFileAttributes(boolean) - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
setIgnoreArchiveFileAttribute(boolean) - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
setIgnoreDateTimeAttributes(boolean) - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
setIgnoreHiddenFileAttribute(boolean) - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
setIgnoreReadOnlyFileAttribute(boolean) - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
setIgnoreSystemFileAttribute(boolean) - +Method in class net.lingala.zip4j.model.UnzipParameters +
  +
setIncludeRootFolder(boolean) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setInternalFileAttr(byte[]) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setIterationCount(int) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
setLastModFileTime(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setLastModFileTime(int) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setLocalFileHeader(LocalFileHeader) - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
setLocalFileHeaderList(List) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setNestedZipFile(boolean) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setNoOfDiskStartOfZip64EndOfCentralDirRec(int) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
setNoOfThisDisk(int) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setNoOfThisDisk(int) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setNoOfThisDiskStartOfCentralDir(int) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setNoOfThisDiskStartOfCentralDir(int) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setOffsetLocalHeader(long) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setOffsetLocalHeader(long) - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
setOffsetOfStartOfCentralDir(long) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setOffsetStartCenDirWRTStartDiskNo(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setOffsetStartOfData(long) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setOffsetZip64EndOfCentralDirRec(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
setOutputStream(FileOutputStream) - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
setParameters(PBKDF2Parameters) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
setPassword(String) - +Method in class net.lingala.zip4j.core.ZipFile +
Sets the password for the zip file.
+ Note: For security reasons, usage of this method is discouraged. +
setPassword(char[]) - +Method in class net.lingala.zip4j.core.ZipFile +
Sets the password for the zip file +
setPassword(char[]) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setPassword(char[]) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setPassword(String) - +Method in class net.lingala.zip4j.model.ZipParameters +
Sets the password for the zip file or the file being added
+ Note: For security reasons, usage of this method is discouraged. +
setPassword(char[]) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setPause(boolean) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setPercentDone(int) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setPseudoRandomFunction(PRF) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
setReadHiddenFiles(boolean) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setResult(int) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setRootFolderInZip(String) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setRunInThread(boolean) - +Method in class net.lingala.zip4j.core.ZipFile +
  +
setSalt(byte[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters +
  +
setSaltBytes(byte[]) - +Method in class net.lingala.zip4j.crypto.AESEncrpyter +
  +
setSignature(long) - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
setSignature(int) - +Method in class net.lingala.zip4j.model.ArchiveExtraDataRecord +
  +
setSignature(long) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setSignature(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setSignature(int) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setSignature(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
setSignature(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setSignatureData(String) - +Method in class net.lingala.zip4j.model.DigitalSignature +
  +
setSize(int) - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
setSizeOfCentralDir(int) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setSizeOfCentralDir(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setSizeOfData(int) - +Method in class net.lingala.zip4j.model.DigitalSignature +
  +
setSizeOfData(int) - +Method in class net.lingala.zip4j.model.ExtraDataRecord +
  +
setSizeOfZip64EndCentralDirRec(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setSourceExternalStream(boolean) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setSourceFile(File) - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
setSourceFileCRC(int) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setSplitArchive(boolean) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setSplitLength(long) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setStart(long) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setState(int) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setStoredMac(byte[]) - +Method in class net.lingala.zip4j.crypto.AESDecrypter +
  +
setTimeZone(TimeZone) - +Method in class net.lingala.zip4j.model.ZipParameters +
  +
setTotalWork(long) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
setTotNoOfEntriesInCentralDir(int) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setTotNoOfEntriesInCentralDir(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setTotNoOfEntriesInCentralDirOnThisDisk(int) - +Method in class net.lingala.zip4j.model.EndCentralDirRecord +
  +
setTotNoOfEntriesInCentralDirOnThisDisk(long) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setTotNumberOfDiscs(int) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
setUncompressedSize(int) - +Method in class net.lingala.zip4j.model.DataDescriptor +
  +
setUncompressedSize(long) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setUncompressedSize(long) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setUnCompressedSize(long) - +Method in class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
setUnzipEngine(UnzipEngine) - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
setVendorID(String) - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
setVersionMadeBy(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setVersionMadeBy(int) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setVersionNeededToExtract(int) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setVersionNeededToExtract(int) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setVersionNeededToExtract(int) - +Method in class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
setVersionNumber(int) - +Method in class net.lingala.zip4j.model.AESExtraDataRecord +
  +
setWriteComprSizeInZip64ExtraRecord(boolean) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setZip64EndCentralDirLocator(Zip64EndCentralDirLocator) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setZip64EndCentralDirRecord(Zip64EndCentralDirRecord) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setZip64ExtendedInfo(Zip64ExtendedInfo) - +Method in class net.lingala.zip4j.model.FileHeader +
  +
setZip64ExtendedInfo(Zip64ExtendedInfo) - +Method in class net.lingala.zip4j.model.LocalFileHeader +
  +
setZip64Format(boolean) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setZipFile(String) - +Method in class net.lingala.zip4j.model.ZipModel +
  +
setZipModel(ZipModel) - +Method in class net.lingala.zip4j.model.UnzipEngineParameters +
  +
skip(long) - +Method in class net.lingala.zip4j.io.InflaterInputStream +
Skips specified number of bytes of uncompressed data. +
skip(long) - +Method in class net.lingala.zip4j.io.PartInputStream +
  +
skip(long) - +Method in class net.lingala.zip4j.io.ZipInputStream +
  +
SplitOutputStream - Class in net.lingala.zip4j.io
 
SplitOutputStream(String) - +Constructor for class net.lingala.zip4j.io.SplitOutputStream +
  +
SplitOutputStream(File) - +Constructor for class net.lingala.zip4j.io.SplitOutputStream +
  +
SplitOutputStream(String, long) - +Constructor for class net.lingala.zip4j.io.SplitOutputStream +
  +
SplitOutputStream(File, long) - +Constructor for class net.lingala.zip4j.io.SplitOutputStream +
  +
SPLITSIG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
StandardDecrypter - Class in net.lingala.zip4j.crypto
 
StandardDecrypter(FileHeader, byte[]) - +Constructor for class net.lingala.zip4j.crypto.StandardDecrypter +
  +
StandardEncrypter - Class in net.lingala.zip4j.crypto
 
StandardEncrypter(char[], int) - +Constructor for class net.lingala.zip4j.crypto.StandardEncrypter +
  +
startNextSplitFile() - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
STATE_BUSY - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
STATE_READY - +Static variable in class net.lingala.zip4j.progress.ProgressMonitor +
  +
STD_DEC_HDR_SIZE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
+
+

+T

+
+
THREAD_NAME - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
toByteArray(int, int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
toByteArray(int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
+
+

+U

+
+
UFT8_NAMES_FLAG - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
Unzip - Class in net.lingala.zip4j.unzip
 
Unzip(ZipModel) - +Constructor for class net.lingala.zip4j.unzip.Unzip +
  +
UnzipEngine - Class in net.lingala.zip4j.unzip
 
UnzipEngine(ZipModel, FileHeader) - +Constructor for class net.lingala.zip4j.unzip.UnzipEngine +
  +
UnzipEngineParameters - Class in net.lingala.zip4j.model
 
UnzipEngineParameters() - +Constructor for class net.lingala.zip4j.model.UnzipEngineParameters +
  +
unzipFile(ProgressMonitor, String, String, UnzipParameters) - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
UnzipParameters - Class in net.lingala.zip4j.model
 
UnzipParameters() - +Constructor for class net.lingala.zip4j.model.UnzipParameters +
  +
UnzipUtil - Class in net.lingala.zip4j.unzip
 
UnzipUtil() - +Constructor for class net.lingala.zip4j.unzip.UnzipUtil +
  +
update(byte[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
update(byte[], int, int) - +Method in class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +
  +
UPDATE_LFH_COMP_SIZE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
UPDATE_LFH_CRC - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
UPDATE_LFH_UNCOMP_SIZE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
updateCRC(int) - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
updateCRC(byte[], int, int) - +Method in class net.lingala.zip4j.unzip.UnzipEngine +
  +
updateKeys(byte) - +Method in class net.lingala.zip4j.crypto.engine.ZipCryptoEngine +
  +
updateLocalFileHeader(LocalFileHeader, long, int, ZipModel, byte[], int, SplitOutputStream) - +Method in class net.lingala.zip4j.core.HeaderWriter +
  +
updateTotalBytesRead(int) - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
updateWorkCompleted(long) - +Method in class net.lingala.zip4j.progress.ProgressMonitor +
  +
+
+

+V

+
+
verifyKey(char[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
VERSION - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
+
+

+W

+
+
write(int) - +Method in class net.lingala.zip4j.io.BaseOutputStream +
  +
write(int) - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
write(byte[]) - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
write(byte[], int, int) - +Method in class net.lingala.zip4j.io.CipherOutputStream +
  +
write(byte[]) - +Method in class net.lingala.zip4j.io.DeflaterOutputStream +
  +
write(int) - +Method in class net.lingala.zip4j.io.DeflaterOutputStream +
  +
write(byte[], int, int) - +Method in class net.lingala.zip4j.io.DeflaterOutputStream +
  +
write(int) - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
write(byte[]) - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
write(byte[], int, int) - +Method in class net.lingala.zip4j.io.SplitOutputStream +
  +
write(int) - +Method in class net.lingala.zip4j.io.ZipOutputStream +
  +
write(byte[]) - +Method in class net.lingala.zip4j.io.ZipOutputStream +
  +
write(byte[], int, int) - +Method in class net.lingala.zip4j.io.ZipOutputStream +
  +
WRITE_MODE - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
writeExtendedLocalHeader(LocalFileHeader, OutputStream) - +Method in class net.lingala.zip4j.core.HeaderWriter +
  +
writeIntLittleEndian(byte[], int, int) - +Static method in class net.lingala.zip4j.util.Raw +
  +
writeLocalFileHeader(ZipModel, LocalFileHeader, OutputStream) - +Method in class net.lingala.zip4j.core.HeaderWriter +
  +
writeLongLittleEndian(byte[], int, long) - +Static method in class net.lingala.zip4j.util.Raw +
  +
writeShortLittleEndian(byte[], int, short) - +Static method in class net.lingala.zip4j.util.Raw +
  +
WRONG_PASSWORD - +Static variable in interface net.lingala.zip4j.exception.ZipExceptionConstants +
  +
+
+

+X

+
+
xor(byte[], byte[]) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
+
+

+Z

+
+
Zip4jConstants - Interface in net.lingala.zip4j.util
 
Zip4jUtil - Class in net.lingala.zip4j.util
 
Zip4jUtil() - +Constructor for class net.lingala.zip4j.util.Zip4jUtil +
  +
ZIP64ENDCENDIRLOC - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ZIP64ENDCENDIRREC - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
Zip64EndCentralDirLocator - Class in net.lingala.zip4j.model
 
Zip64EndCentralDirLocator() - +Constructor for class net.lingala.zip4j.model.Zip64EndCentralDirLocator +
  +
Zip64EndCentralDirRecord - Class in net.lingala.zip4j.model
 
Zip64EndCentralDirRecord() - +Constructor for class net.lingala.zip4j.model.Zip64EndCentralDirRecord +
  +
Zip64ExtendedInfo - Class in net.lingala.zip4j.model
 
Zip64ExtendedInfo() - +Constructor for class net.lingala.zip4j.model.Zip64ExtendedInfo +
  +
ZIP_64_LIMIT - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ZIP_FILE_SEPARATOR - +Static variable in interface net.lingala.zip4j.util.InternalZipConstants +
  +
ZipCryptoEngine - Class in net.lingala.zip4j.crypto.engine
 
ZipCryptoEngine() - +Constructor for class net.lingala.zip4j.crypto.engine.ZipCryptoEngine +
  +
ZipEngine - Class in net.lingala.zip4j.zip
 
ZipEngine(ZipModel) - +Constructor for class net.lingala.zip4j.zip.ZipEngine +
  +
ZipException - Exception in net.lingala.zip4j.exception
 
ZipException() - +Constructor for exception net.lingala.zip4j.exception.ZipException +
  +
ZipException(String) - +Constructor for exception net.lingala.zip4j.exception.ZipException +
  +
ZipException(String, Throwable) - +Constructor for exception net.lingala.zip4j.exception.ZipException +
  +
ZipException(String, int) - +Constructor for exception net.lingala.zip4j.exception.ZipException +
  +
ZipException(String, Throwable, int) - +Constructor for exception net.lingala.zip4j.exception.ZipException +
  +
ZipException(Throwable) - +Constructor for exception net.lingala.zip4j.exception.ZipException +
  +
ZipException(Throwable, int) - +Constructor for exception net.lingala.zip4j.exception.ZipException +
  +
ZipExceptionConstants - Interface in net.lingala.zip4j.exception
 
ZipFile - Class in net.lingala.zip4j.core
Base class to handle zip files.
ZipFile(String) - +Constructor for class net.lingala.zip4j.core.ZipFile +
Creates a new Zip File Object with the given zip file path. +
ZipFile(File) - +Constructor for class net.lingala.zip4j.core.ZipFile +
Creates a new Zip File Object with the input file. +
ZipInputStream - Class in net.lingala.zip4j.io
 
ZipInputStream(BaseInputStream) - +Constructor for class net.lingala.zip4j.io.ZipInputStream +
  +
zipModel - +Variable in class net.lingala.zip4j.io.CipherOutputStream +
  +
ZipModel - Class in net.lingala.zip4j.model
 
ZipModel() - +Constructor for class net.lingala.zip4j.model.ZipModel +
  +
ZipOutputStream - Class in net.lingala.zip4j.io
 
ZipOutputStream(OutputStream) - +Constructor for class net.lingala.zip4j.io.ZipOutputStream +
  +
ZipOutputStream(OutputStream, ZipModel) - +Constructor for class net.lingala.zip4j.io.ZipOutputStream +
  +
zipParameters - +Variable in class net.lingala.zip4j.io.CipherOutputStream +
  +
ZipParameters - Class in net.lingala.zip4j.model
 
ZipParameters() - +Constructor for class net.lingala.zip4j.model.ZipParameters +
  +
+
+

+_

+
+
_F(byte[], int, PRF, byte[], int, int) - +Method in class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +
  +
+
+A B C D E F G H I J L M N O P R S T U V W X Z _ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/index.html b/lib/zip4j/javadoc/index.html new file mode 100644 index 00000000..f03949c1 --- /dev/null +++ b/lib/zip4j/javadoc/index.html @@ -0,0 +1,40 @@ + + + + + + + +zip4j 1.3.1 API + + + + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="overview-summary.html">Non-frame version.</A> + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/HeaderReader.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/HeaderReader.html new file mode 100644 index 00000000..010dbb8b --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/HeaderReader.html @@ -0,0 +1,320 @@ + + + + + + + +HeaderReader (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.core +
+Class HeaderReader

+
+java.lang.Object
+  extended by net.lingala.zip4j.core.HeaderReader
+
+
+
+
public class HeaderReader
extends Object
+ + +

+Helper class to read header information for the zip file +

+ +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
HeaderReader(RandomAccessFile zip4jRaf) + +
+          Creates a new HeaderReader object with the given input stream
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ ZipModelreadAllHeaders() + +
+          Reads all the header information for the zip file.
+ ZipModelreadAllHeaders(String fileNameCharset) + +
+          Reads all the header information for the zip file.
+ LocalFileHeaderreadLocalFileHeader(FileHeader fileHeader) + +
+          Reads local file header for the given file header
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+HeaderReader

+
+public HeaderReader(RandomAccessFile zip4jRaf)
+
+
Creates a new HeaderReader object with the given input stream +

+

+
Parameters:
zip4jRaf -
+
+ + + + + + + + +
+Method Detail
+ +

+readAllHeaders

+
+public ZipModel readAllHeaders()
+                        throws ZipException
+
+
Reads all the header information for the zip file. +

Note: This method does not read local file header information +

+

+ +
Returns:
ZipModel +
Throws: +
ZipException
+
+
+
+ +

+readAllHeaders

+
+public ZipModel readAllHeaders(String fileNameCharset)
+                        throws ZipException
+
+
Reads all the header information for the zip file. File names are read with + input charset name. If this parameter is null, default system charset is used. +

Note: This method does not read local file header information +

+

+ +
Returns:
ZipModel +
Throws: +
ZipException
+
+
+
+ +

+readLocalFileHeader

+
+public LocalFileHeader readLocalFileHeader(FileHeader fileHeader)
+                                    throws ZipException
+
+
Reads local file header for the given file header +

+

+
Parameters:
fileHeader - +
Returns:
LocalFileHeader +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/HeaderWriter.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/HeaderWriter.html new file mode 100644 index 00000000..c3edacad --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/HeaderWriter.html @@ -0,0 +1,375 @@ + + + + + + + +HeaderWriter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.core +
+Class HeaderWriter

+
+java.lang.Object
+  extended by net.lingala.zip4j.core.HeaderWriter
+
+
+
+
public class HeaderWriter
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
HeaderWriter() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidfinalizeZipFile(ZipModel zipModel, + OutputStream outputStream) + +
+          Processes zip header data and writes this data to the zip file
+ voidfinalizeZipFileWithoutValidations(ZipModel zipModel, + OutputStream outputStream) + +
+          Processes zip header data and writes this data to the zip file without any validations.
+ voidupdateLocalFileHeader(LocalFileHeader localFileHeader, + long offset, + int toUpdate, + ZipModel zipModel, + byte[] bytesToWrite, + int noOfDisk, + SplitOutputStream outputStream) + +
+           
+ intwriteExtendedLocalHeader(LocalFileHeader localFileHeader, + OutputStream outputStream) + +
+           
+ intwriteLocalFileHeader(ZipModel zipModel, + LocalFileHeader localFileHeader, + OutputStream outputStream) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+HeaderWriter

+
+public HeaderWriter()
+
+
+ + + + + + + + +
+Method Detail
+ +

+writeLocalFileHeader

+
+public int writeLocalFileHeader(ZipModel zipModel,
+                                LocalFileHeader localFileHeader,
+                                OutputStream outputStream)
+                         throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+writeExtendedLocalHeader

+
+public int writeExtendedLocalHeader(LocalFileHeader localFileHeader,
+                                    OutputStream outputStream)
+                             throws ZipException,
+                                    IOException
+
+
+ +
Throws: +
ZipException +
IOException
+
+
+
+ +

+finalizeZipFile

+
+public void finalizeZipFile(ZipModel zipModel,
+                            OutputStream outputStream)
+                     throws ZipException
+
+
Processes zip header data and writes this data to the zip file +

+

+
Parameters:
zipModel -
outputStream - +
Throws: +
ZipException
+
+
+
+ +

+finalizeZipFileWithoutValidations

+
+public void finalizeZipFileWithoutValidations(ZipModel zipModel,
+                                              OutputStream outputStream)
+                                       throws ZipException
+
+
Processes zip header data and writes this data to the zip file without any validations. + This process is not intended to use for normal operations (adding, deleting, etc) of a zip file. + This method is used when certain validations need to be skipped (ex: Merging split zip files, + adding comment to a zip file, etc) +

+

+
Parameters:
zipModel -
outputStream - +
Throws: +
ZipException
+
+
+
+ +

+updateLocalFileHeader

+
+public void updateLocalFileHeader(LocalFileHeader localFileHeader,
+                                  long offset,
+                                  int toUpdate,
+                                  ZipModel zipModel,
+                                  byte[] bytesToWrite,
+                                  int noOfDisk,
+                                  SplitOutputStream outputStream)
+                           throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/ZipFile.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/ZipFile.html new file mode 100644 index 00000000..242745d0 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/ZipFile.html @@ -0,0 +1,1376 @@ + + + + + + + +ZipFile (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.core +
+Class ZipFile

+
+java.lang.Object
+  extended by net.lingala.zip4j.core.ZipFile
+
+
+
+
public class ZipFile
extends Object
+ + +

+Base class to handle zip files. Some of the operations supported + in this class are:
+

+

+ +

+


+ +

+ + + + + + + + + + + + + + +
+Constructor Summary
ZipFile(File zipFile) + +
+          Creates a new Zip File Object with the input file.
ZipFile(String zipFile) + +
+          Creates a new Zip File Object with the given zip file path.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddFile(File sourceFile, + ZipParameters parameters) + +
+          Adds input source file to the zip file.
+ voidaddFiles(ArrayList sourceFileList, + ZipParameters parameters) + +
+          Adds the list of input files to the zip file.
+ voidaddFolder(File path, + ZipParameters parameters) + +
+          Adds the folder in the given file object to the zip file.
+ voidaddFolder(String path, + ZipParameters parameters) + +
+          Adds the folder in the given path to the zip file.
+ voidaddStream(InputStream inputStream, + ZipParameters parameters) + +
+          Creates a new entry in the zip file and adds the content of the inputstream to the + zip file.
+ voidcreateZipFile(ArrayList sourceFileList, + ZipParameters parameters) + +
+          Creates a zip file and adds the list of source file(s) to the zip file.
+ voidcreateZipFile(ArrayList sourceFileList, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the list of source file(s) to the zip file.
+ voidcreateZipFile(File sourceFile, + ZipParameters parameters) + +
+          Creates a zip file and adds the source file to the zip file.
+ voidcreateZipFile(File sourceFile, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the source file to the zip file.
+ voidcreateZipFileFromFolder(File folderToAdd, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the files/folders from the specified folder to the zip file.
+ voidcreateZipFileFromFolder(String folderToAdd, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the files/folders from the specified folder to the zip file.
+ voidextractAll(String destPath) + +
+          Extracts all the files in the given zip file to the input destination path.
+ voidextractAll(String destPath, + UnzipParameters unzipParameters) + +
+          Extracts all the files in the given zip file to the input destination path.
+ voidextractFile(FileHeader fileHeader, + String destPath) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidextractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidextractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters, + String newFileName) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidextractFile(String fileName, + String destPath) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidextractFile(String fileName, + String destPath, + UnzipParameters unzipParameters) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidextractFile(String fileName, + String destPath, + UnzipParameters unzipParameters, + String newFileName) + +
+          Extracts a specific file from the zip file to the destination path.
+ StringgetComment() + +
+          Returns the comment set for the Zip file
+ StringgetComment(String encoding) + +
+          Returns the comment set for the Zip file in the input encoding
+ FilegetFile() + +
+          Returns the File object of the zip file
+ FileHeadergetFileHeader(String fileName) + +
+          Returns FileHeader if a file header with the given fileHeader + string exists in the zip model: If not returns null
+ ListgetFileHeaders() + +
+          Returns the list of file headers in the zip file.
+ ZipInputStreamgetInputStream(FileHeader fileHeader) + +
+          Returns an input stream for reading the contents of the Zip file corresponding + to the input FileHeader.
+ ProgressMonitorgetProgressMonitor() + +
+           
+ ArrayListgetSplitZipFiles() + +
+          Returns the full file path+names of all split zip files + in an ArrayList.
+ booleanisEncrypted() + +
+          Checks to see if the zip file is encrypted
+ booleanisRunInThread() + +
+           
+ booleanisSplitArchive() + +
+          Checks if the zip file is a split archive
+ booleanisValidZipFile() + +
+          Checks to see if the input zip file is a valid zip file.
+ voidmergeSplitFiles(File outputZipFile) + +
+          Merges split zip files into a single zip file without the need to extract the + files in the archive
+ voidremoveFile(FileHeader fileHeader) + +
+          Removes the file provided in the input file header from the zip file.
+ voidremoveFile(String fileName) + +
+          Removes the file provided in the input paramters from the zip file.
+ voidsetComment(String comment) + +
+          Sets comment for the Zip file
+ voidsetFileNameCharset(String charsetName) + +
+          Zip4j will encode all the file names with the input charset.
+ voidsetPassword(char[] password) + +
+          Sets the password for the zip file
+ voidsetPassword(String password) + +
+          Sets the password for the zip file.
+ Note: For security reasons, usage of this method is discouraged.
+ voidsetRunInThread(boolean runInThread) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipFile

+
+public ZipFile(String zipFile)
+        throws ZipException
+
+
Creates a new Zip File Object with the given zip file path. + If the zip file does not exist, it is not created at this point. +

+

+
Parameters:
zipFile - +
Throws: +
ZipException
+
+
+ +

+ZipFile

+
+public ZipFile(File zipFile)
+        throws ZipException
+
+
Creates a new Zip File Object with the input file. + If the zip file does not exist, it is not created at this point. +

+

+
Parameters:
zipFile - +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+createZipFile

+
+public void createZipFile(File sourceFile,
+                          ZipParameters parameters)
+                   throws ZipException
+
+
Creates a zip file and adds the source file to the zip file. If the zip file + exists then this method throws an exception. Parameters such as compression type, etc + can be set in the input parameters +

+

+
Parameters:
sourceFile - - File to be added to the zip file
parameters - - parameters to create the zip file +
Throws: +
ZipException
+
+
+
+ +

+createZipFile

+
+public void createZipFile(File sourceFile,
+                          ZipParameters parameters,
+                          boolean splitArchive,
+                          long splitLength)
+                   throws ZipException
+
+
Creates a zip file and adds the source file to the zip file. If the zip file + exists then this method throws an exception. Parameters such as compression type, etc + can be set in the input parameters. While the method addFile/addFiles also creates the + zip file if it does not exist, the main functionality of this method is to create a split + zip file. To create a split zip file, set the splitArchive parameter to true with a valid + splitLength. Split Length has to be more than 65536 bytes +

+

+
Parameters:
sourceFile - - File to be added to the zip file
parameters - - parameters to create the zip file
splitArchive - - if archive has to be split or not
splitLength - - if archive has to be split, then length in bytes at which it has to be split +
Throws: +
ZipException
+
+
+
+ +

+createZipFile

+
+public void createZipFile(ArrayList sourceFileList,
+                          ZipParameters parameters)
+                   throws ZipException
+
+
Creates a zip file and adds the list of source file(s) to the zip file. If the zip file + exists then this method throws an exception. Parameters such as compression type, etc + can be set in the input parameters +

+

+
Parameters:
sourceFileList - - File to be added to the zip file
parameters - - parameters to create the zip file +
Throws: +
ZipException
+
+
+
+ +

+createZipFile

+
+public void createZipFile(ArrayList sourceFileList,
+                          ZipParameters parameters,
+                          boolean splitArchive,
+                          long splitLength)
+                   throws ZipException
+
+
Creates a zip file and adds the list of source file(s) to the zip file. If the zip file + exists then this method throws an exception. Parameters such as compression type, etc + can be set in the input parameters. While the method addFile/addFiles also creates the + zip file if it does not exist, the main functionality of this method is to create a split + zip file. To create a split zip file, set the splitArchive parameter to true with a valid + splitLength. Split Length has to be more than 65536 bytes +

+

+
Parameters:
sourceFileList - - File to be added to the zip file
parameters - - zip parameters for this file list
splitArchive - - if archive has to be split or not
splitLength - - if archive has to be split, then length in bytes at which it has to be split +
Throws: +
ZipException
+
+
+
+ +

+createZipFileFromFolder

+
+public void createZipFileFromFolder(String folderToAdd,
+                                    ZipParameters parameters,
+                                    boolean splitArchive,
+                                    long splitLength)
+                             throws ZipException
+
+
Creates a zip file and adds the files/folders from the specified folder to the zip file. + This method does the same functionality as in addFolder method except that this method + can also create split zip files when adding a folder. To create a split zip file, set the + splitArchive parameter to true and specify the splitLength. Split length has to be more than + or equal to 65536 bytes. Note that this method throws an exception if the zip file already + exists. +

+

+
Parameters:
folderToAdd -
parameters -
splitArchive -
splitLength - +
Throws: +
ZipException
+
+
+
+ +

+createZipFileFromFolder

+
+public void createZipFileFromFolder(File folderToAdd,
+                                    ZipParameters parameters,
+                                    boolean splitArchive,
+                                    long splitLength)
+                             throws ZipException
+
+
Creates a zip file and adds the files/folders from the specified folder to the zip file. + This method does the same functionality as in addFolder method except that this method + can also create split zip files when adding a folder. To create a split zip file, set the + splitArchive parameter to true and specify the splitLength. Split length has to be more than + or equal to 65536 bytes. Note that this method throws an exception if the zip file already + exists. +

+

+
Parameters:
folderToAdd -
parameters -
splitArchive -
splitLength - +
Throws: +
ZipException
+
+
+
+ +

+addFile

+
+public void addFile(File sourceFile,
+                    ZipParameters parameters)
+             throws ZipException
+
+
Adds input source file to the zip file. If zip file does not exist, then + this method creates a new zip file. Parameters such as compression type, etc + can be set in the input parameters. +

+

+
Parameters:
sourceFile - - File to tbe added to the zip file
parameters - - zip parameters for this file +
Throws: +
ZipException
+
+
+
+ +

+addFiles

+
+public void addFiles(ArrayList sourceFileList,
+                     ZipParameters parameters)
+              throws ZipException
+
+
Adds the list of input files to the zip file. If zip file does not exist, then + this method creates a new zip file. Parameters such as compression type, etc + can be set in the input parameters. +

+

+
Parameters:
sourceFileList -
parameters - +
Throws: +
ZipException
+
+
+
+ +

+addFolder

+
+public void addFolder(String path,
+                      ZipParameters parameters)
+               throws ZipException
+
+
Adds the folder in the given path to the zip file. If zip file does not exist, + then a new zip file is created. If input folder path is invalid then an exception + is thrown. Zip parameters for the files in the folder to be added can be set in + the input parameters +

+

+
Parameters:
path -
parameters - +
Throws: +
ZipException
+
+
+
+ +

+addFolder

+
+public void addFolder(File path,
+                      ZipParameters parameters)
+               throws ZipException
+
+
Adds the folder in the given file object to the zip file. If zip file does not exist, + then a new zip file is created. If input folder is invalid then an exception + is thrown. Zip parameters for the files in the folder to be added can be set in + the input parameters +

+

+
Parameters:
path -
parameters - +
Throws: +
ZipException
+
+
+
+ +

+addStream

+
+public void addStream(InputStream inputStream,
+                      ZipParameters parameters)
+               throws ZipException
+
+
Creates a new entry in the zip file and adds the content of the inputstream to the + zip file. ZipParameters.isSourceExternalStream and ZipParameters.fileNameInZip have to be + set before in the input parameters. If the file name ends with / or \, this method treats the + content as a directory. Setting the flag ProgressMonitor.setRunInThread to true will have + no effect for this method and hence this method cannot be used to add content to zip in + thread mode +

+

+
Parameters:
inputStream -
parameters - +
Throws: +
ZipException
+
+
+
+ +

+extractAll

+
+public void extractAll(String destPath)
+                throws ZipException
+
+
Extracts all the files in the given zip file to the input destination path. + If zip file does not exist or destination path is invalid then an + exception is thrown. +

+

+
Parameters:
destPath - +
Throws: +
ZipException
+
+
+
+ +

+extractAll

+
+public void extractAll(String destPath,
+                       UnzipParameters unzipParameters)
+                throws ZipException
+
+
Extracts all the files in the given zip file to the input destination path. + If zip file does not exist or destination path is invalid then an + exception is thrown. +

+

+
Parameters:
destPath -
unzipParameters - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(FileHeader fileHeader,
+                        String destPath)
+                 throws ZipException
+
+
Extracts a specific file from the zip file to the destination path. + If destination path is invalid, then this method throws an exception. +

+

+
Parameters:
fileHeader -
destPath - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(FileHeader fileHeader,
+                        String destPath,
+                        UnzipParameters unzipParameters)
+                 throws ZipException
+
+
Extracts a specific file from the zip file to the destination path. + If destination path is invalid, then this method throws an exception. +

+ If newFileName is not null or empty, newly created file name will be replaced by + the value in newFileName. If this value is null, then the file name will be the + value in FileHeader.getFileName +

+

+
Parameters:
fileHeader -
destPath -
unzipParameters - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(FileHeader fileHeader,
+                        String destPath,
+                        UnzipParameters unzipParameters,
+                        String newFileName)
+                 throws ZipException
+
+
Extracts a specific file from the zip file to the destination path. + If destination path is invalid, then this method throws an exception. +

+

+
Parameters:
fileHeader -
destPath -
unzipParameters -
newFileName - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(String fileName,
+                        String destPath)
+                 throws ZipException
+
+
Extracts a specific file from the zip file to the destination path. + This method first finds the necessary file header from the input file name. +

+ File name is relative file name in the zip file. For example if a zip file contains + a file "a.txt", then to extract this file, input file name has to be "a.txt". Another + example is if there is a file "b.txt" in a folder "abc" in the zip file, then the + input file name has to be abc/b.txt +

+ Throws an exception if file header could not be found for the given file name or if + the destination path is invalid +

+

+
Parameters:
fileName -
destPath - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(String fileName,
+                        String destPath,
+                        UnzipParameters unzipParameters)
+                 throws ZipException
+
+
Extracts a specific file from the zip file to the destination path. + This method first finds the necessary file header from the input file name. +

+ File name is relative file name in the zip file. For example if a zip file contains + a file "a.txt", then to extract this file, input file name has to be "a.txt". Another + example is if there is a file "b.txt" in a folder "abc" in the zip file, then the + input file name has to be abc/b.txt +

+ Throws an exception if file header could not be found for the given file name or if + the destination path is invalid +

+

+
Parameters:
fileName -
destPath -
unzipParameters - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(String fileName,
+                        String destPath,
+                        UnzipParameters unzipParameters,
+                        String newFileName)
+                 throws ZipException
+
+
Extracts a specific file from the zip file to the destination path. + This method first finds the necessary file header from the input file name. +

+ File name is relative file name in the zip file. For example if a zip file contains + a file "a.txt", then to extract this file, input file name has to be "a.txt". Another + example is if there is a file "b.txt" in a folder "abc" in the zip file, then the + input file name has to be abc/b.txt +

+ If newFileName is not null or empty, newly created file name will be replaced by + the value in newFileName. If this value is null, then the file name will be the + value in FileHeader.getFileName +

+ Throws an exception if file header could not be found for the given file name or if + the destination path is invalid +

+

+
Parameters:
fileName -
destPath -
unzipParameters -
newFileName - +
Throws: +
ZipException
+
+
+
+ +

+setPassword

+
+public void setPassword(String password)
+                 throws ZipException
+
+
Sets the password for the zip file.
+ Note: For security reasons, usage of this method is discouraged. Use + setPassword(char[]) instead. As strings are immutable, they cannot be wiped + out from memory explicitly after usage. Therefore, usage of Strings to store + passwords is discouraged. More info here: + http://docs.oracle.com/javase/1.5.0/docs/guide/security/jce/JCERefGuide.html#PBEEx +

+

+
Parameters:
password - +
Throws: +
ZipException
+
+
+
+ +

+setPassword

+
+public void setPassword(char[] password)
+                 throws ZipException
+
+
Sets the password for the zip file +

+

+
Parameters:
password - +
Throws: +
ZipException
+
+
+
+ +

+getFileHeaders

+
+public List getFileHeaders()
+                    throws ZipException
+
+
Returns the list of file headers in the zip file. Throws an exception if the + zip file does not exist +

+

+ +
Returns:
list of file headers +
Throws: +
ZipException
+
+
+
+ +

+getFileHeader

+
+public FileHeader getFileHeader(String fileName)
+                         throws ZipException
+
+
Returns FileHeader if a file header with the given fileHeader + string exists in the zip model: If not returns null +

+

+
Parameters:
fileName - +
Returns:
FileHeader +
Throws: +
ZipException
+
+
+
+ +

+isEncrypted

+
+public boolean isEncrypted()
+                    throws ZipException
+
+
Checks to see if the zip file is encrypted +

+

+ +
Returns:
true if encrypted, false if not +
Throws: +
ZipException
+
+
+
+ +

+isSplitArchive

+
+public boolean isSplitArchive()
+                       throws ZipException
+
+
Checks if the zip file is a split archive +

+

+ +
Returns:
true if split archive, false if not +
Throws: +
ZipException
+
+
+
+ +

+removeFile

+
+public void removeFile(String fileName)
+                throws ZipException
+
+
Removes the file provided in the input paramters from the zip file. + This method first finds the file header and then removes the file. + If file does not exist, then this method throws an exception. + If zip file is a split zip file, then this method throws an exception as + zip specification does not allow for updating split zip archives. +

+

+
Parameters:
fileName - +
Throws: +
ZipException
+
+
+
+ +

+removeFile

+
+public void removeFile(FileHeader fileHeader)
+                throws ZipException
+
+
Removes the file provided in the input file header from the zip file. + If zip file is a split zip file, then this method throws an exception as + zip specification does not allow for updating split zip archives. +

+

+
Parameters:
fileHeader - +
Throws: +
ZipException
+
+
+
+ +

+mergeSplitFiles

+
+public void mergeSplitFiles(File outputZipFile)
+                     throws ZipException
+
+
Merges split zip files into a single zip file without the need to extract the + files in the archive +

+

+
Parameters:
outputZipFile - +
Throws: +
ZipException
+
+
+
+ +

+setComment

+
+public void setComment(String comment)
+                throws ZipException
+
+
Sets comment for the Zip file +

+

+
Parameters:
comment - +
Throws: +
ZipException
+
+
+
+ +

+getComment

+
+public String getComment()
+                  throws ZipException
+
+
Returns the comment set for the Zip file +

+

+ +
Returns:
String +
Throws: +
ZipException
+
+
+
+ +

+getComment

+
+public String getComment(String encoding)
+                  throws ZipException
+
+
Returns the comment set for the Zip file in the input encoding +

+

+
Parameters:
encoding - +
Returns:
String +
Throws: +
ZipException
+
+
+
+ +

+setFileNameCharset

+
+public void setFileNameCharset(String charsetName)
+                        throws ZipException
+
+
Zip4j will encode all the file names with the input charset. This method throws + an exception if the Charset is not supported +

+

+
Parameters:
charsetName - +
Throws: +
ZipException
+
+
+
+ +

+getInputStream

+
+public ZipInputStream getInputStream(FileHeader fileHeader)
+                              throws ZipException
+
+
Returns an input stream for reading the contents of the Zip file corresponding + to the input FileHeader. Throws an exception if the FileHeader does not exist + in the ZipFile +

+

+
Parameters:
fileHeader - +
Returns:
ZipInputStream +
Throws: +
ZipException
+
+
+
+ +

+isValidZipFile

+
+public boolean isValidZipFile()
+
+
Checks to see if the input zip file is a valid zip file. This method + will try to read zip headers. If headers are read successfully, this + method returns true else false +

+

+ +
Returns:
boolean
Since:
+
1.2.3
+
+
+
+
+ +

+getSplitZipFiles

+
+public ArrayList getSplitZipFiles()
+                           throws ZipException
+
+
Returns the full file path+names of all split zip files + in an ArrayList. For example: If a split zip file(abc.zip) has a 10 split parts + this method returns an array list with path + "abc.z01", path + "abc.z02", etc. + Returns null if the zip file does not exist +

+

+ +
Returns:
ArrayList of Strings +
Throws: +
ZipException
+
+
+
+ +

+getProgressMonitor

+
+public ProgressMonitor getProgressMonitor()
+
+
+
+
+
+
+ +

+isRunInThread

+
+public boolean isRunInThread()
+
+
+
+
+
+
+ +

+setRunInThread

+
+public void setRunInThread(boolean runInThread)
+
+
+
+
+
+
+ +

+getFile

+
+public File getFile()
+
+
Returns the File object of the zip file +

+

+ +
Returns:
File
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/HeaderReader.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/HeaderReader.html new file mode 100644 index 00000000..220d0eb9 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/HeaderReader.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.core.HeaderReader (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.core.HeaderReader

+
+No usage of net.lingala.zip4j.core.HeaderReader +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/HeaderWriter.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/HeaderWriter.html new file mode 100644 index 00000000..3ddd1ea2 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/HeaderWriter.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.core.HeaderWriter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.core.HeaderWriter

+
+No usage of net.lingala.zip4j.core.HeaderWriter +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/ZipFile.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/ZipFile.html new file mode 100644 index 00000000..b4c4dcb7 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/class-use/ZipFile.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.core.ZipFile (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.core.ZipFile

+
+No usage of net.lingala.zip4j.core.ZipFile +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-frame.html new file mode 100644 index 00000000..f6e06d26 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-frame.html @@ -0,0 +1,37 @@ + + + + + + + +net.lingala.zip4j.core (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.core + + + + +
+Classes  + +
+HeaderReader +
+HeaderWriter +
+ZipFile
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-summary.html new file mode 100644 index 00000000..0cc19fd1 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-summary.html @@ -0,0 +1,166 @@ + + + + + + + +net.lingala.zip4j.core (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.core +

+ + + + + + + + + + + + + + + + + +
+Class Summary
HeaderReaderHelper class to read header information for the zip file
HeaderWriter 
ZipFileBase class to handle zip files.
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-tree.html new file mode 100644 index 00000000..8c642cb5 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-tree.html @@ -0,0 +1,154 @@ + + + + + + + +net.lingala.zip4j.core Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.core +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/core/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-use.html new file mode 100644 index 00000000..03e3b6b1 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/core/package-use.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Package net.lingala.zip4j.core (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.core

+
+No usage of net.lingala.zip4j.core +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/AESDecrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/AESDecrypter.html new file mode 100644 index 00000000..726142e1 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/AESDecrypter.html @@ -0,0 +1,410 @@ + + + + + + + +AESDecrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto +
+Class AESDecrypter

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.AESDecrypter
+
+
+
All Implemented Interfaces:
IDecrypter
+
+
+
+
public class AESDecrypter
extends Object
implements IDecrypter
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
AESDecrypter(LocalFileHeader localFileHeader, + byte[] salt, + byte[] passwordVerifier) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intdecryptData(byte[] buff) + +
+           
+ intdecryptData(byte[] buff, + int start, + int len) + +
+           
+ byte[]getCalculatedAuthenticationBytes() + +
+           
+ intgetPasswordVerifierLength() + +
+           
+ intgetSaltLength() + +
+           
+ byte[]getStoredMac() + +
+           
+ voidsetStoredMac(byte[] storedMac) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+AESDecrypter

+
+public AESDecrypter(LocalFileHeader localFileHeader,
+                    byte[] salt,
+                    byte[] passwordVerifier)
+             throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+decryptData

+
+public int decryptData(byte[] buff,
+                       int start,
+                       int len)
+                throws ZipException
+
+
+
Specified by:
decryptData in interface IDecrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+decryptData

+
+public int decryptData(byte[] buff)
+                throws ZipException
+
+
+
Specified by:
decryptData in interface IDecrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getPasswordVerifierLength

+
+public int getPasswordVerifierLength()
+
+
+
+
+
+
+
+
+
+ +

+getSaltLength

+
+public int getSaltLength()
+
+
+
+
+
+
+
+
+
+ +

+getCalculatedAuthenticationBytes

+
+public byte[] getCalculatedAuthenticationBytes()
+
+
+
+
+
+
+
+
+
+ +

+setStoredMac

+
+public void setStoredMac(byte[] storedMac)
+
+
+
+
+
+
+
+
+
+ +

+getStoredMac

+
+public byte[] getStoredMac()
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/AESEncrpyter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/AESEncrpyter.html new file mode 100644 index 00000000..d7f7d3ef --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/AESEncrpyter.html @@ -0,0 +1,452 @@ + + + + + + + +AESEncrpyter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto +
+Class AESEncrpyter

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.AESEncrpyter
+
+
+
All Implemented Interfaces:
IEncrypter
+
+
+
+
public class AESEncrpyter
extends Object
implements IEncrypter
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
AESEncrpyter(char[] password, + int keyStrength) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intencryptData(byte[] buff) + +
+           
+ intencryptData(byte[] buff, + int start, + int len) + +
+           
+ byte[]getDerivedPasswordVerifier() + +
+           
+ byte[]getFinalMac() + +
+           
+ intgetPasswordVeriifierLength() + +
+           
+ byte[]getSaltBytes() + +
+           
+ intgetSaltLength() + +
+           
+ voidsetDerivedPasswordVerifier(byte[] derivedPasswordVerifier) + +
+           
+ voidsetSaltBytes(byte[] saltBytes) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+AESEncrpyter

+
+public AESEncrpyter(char[] password,
+                    int keyStrength)
+             throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+encryptData

+
+public int encryptData(byte[] buff)
+                throws ZipException
+
+
+
Specified by:
encryptData in interface IEncrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+encryptData

+
+public int encryptData(byte[] buff,
+                       int start,
+                       int len)
+                throws ZipException
+
+
+
Specified by:
encryptData in interface IEncrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getFinalMac

+
+public byte[] getFinalMac()
+
+
+
+
+
+
+
+
+
+ +

+getDerivedPasswordVerifier

+
+public byte[] getDerivedPasswordVerifier()
+
+
+
+
+
+
+
+
+
+ +

+setDerivedPasswordVerifier

+
+public void setDerivedPasswordVerifier(byte[] derivedPasswordVerifier)
+
+
+
+
+
+
+
+
+
+ +

+getSaltBytes

+
+public byte[] getSaltBytes()
+
+
+
+
+
+
+
+
+
+ +

+setSaltBytes

+
+public void setSaltBytes(byte[] saltBytes)
+
+
+
+
+
+
+
+
+
+ +

+getSaltLength

+
+public int getSaltLength()
+
+
+
+
+
+
+
+
+
+ +

+getPasswordVeriifierLength

+
+public int getPasswordVeriifierLength()
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/IDecrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/IDecrypter.html new file mode 100644 index 00000000..e7b2685d --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/IDecrypter.html @@ -0,0 +1,239 @@ + + + + + + + +IDecrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto +
+Interface IDecrypter

+
+
All Known Implementing Classes:
AESDecrypter, StandardDecrypter
+
+
+
+
public interface IDecrypter
+ + +

+


+ +

+ + + + + + + + + + + + + + + + +
+Method Summary
+ intdecryptData(byte[] buff) + +
+           
+ intdecryptData(byte[] buff, + int start, + int len) + +
+           
+  +

+ + + + + + + + +
+Method Detail
+ +

+decryptData

+
+int decryptData(byte[] buff,
+                int start,
+                int len)
+                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+decryptData

+
+int decryptData(byte[] buff)
+                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/IEncrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/IEncrypter.html new file mode 100644 index 00000000..c8b3148e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/IEncrypter.html @@ -0,0 +1,239 @@ + + + + + + + +IEncrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto +
+Interface IEncrypter

+
+
All Known Implementing Classes:
AESEncrpyter, StandardEncrypter
+
+
+
+
public interface IEncrypter
+ + +

+


+ +

+ + + + + + + + + + + + + + + + +
+Method Summary
+ intencryptData(byte[] buff) + +
+           
+ intencryptData(byte[] buff, + int start, + int len) + +
+           
+  +

+ + + + + + + + +
+Method Detail
+ +

+encryptData

+
+int encryptData(byte[] buff)
+                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+encryptData

+
+int encryptData(byte[] buff,
+                int start,
+                int len)
+                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.html new file mode 100644 index 00000000..7f07f2f0 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.html @@ -0,0 +1,458 @@ + + + + + + + +MacBasedPRF (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto.PBKDF2 +
+Class MacBasedPRF

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF
+
+
+
+
public class MacBasedPRF
extends Object
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + +
+Field Summary
+protected  inthLen + +
+           
+protected  Macmac + +
+           
+protected  StringmacAlgorithm + +
+           
+  + + + + + + + + + + + + + +
+Constructor Summary
MacBasedPRF(String macAlgorithm) + +
+           
MacBasedPRF(String macAlgorithm, + String provider) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ byte[]doFinal() + +
+           
+ byte[]doFinal(byte[] M) + +
+           
+ intgetHLen() + +
+           
+ voidinit(byte[] P) + +
+           
+ voidupdate(byte[] U) + +
+           
+ voidupdate(byte[] U, + int start, + int len) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+mac

+
+protected Mac mac
+
+
+
+
+
+ +

+hLen

+
+protected int hLen
+
+
+
+
+
+ +

+macAlgorithm

+
+protected String macAlgorithm
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+MacBasedPRF

+
+public MacBasedPRF(String macAlgorithm)
+
+
+
+ +

+MacBasedPRF

+
+public MacBasedPRF(String macAlgorithm,
+                   String provider)
+
+
+ + + + + + + + +
+Method Detail
+ +

+doFinal

+
+public byte[] doFinal(byte[] M)
+
+
+
+
+
+
+
+
+
+ +

+doFinal

+
+public byte[] doFinal()
+
+
+
+
+
+
+
+
+
+ +

+getHLen

+
+public int getHLen()
+
+
+
+
+
+
+
+
+
+ +

+init

+
+public void init(byte[] P)
+
+
+
+
+
+
+
+
+
+ +

+update

+
+public void update(byte[] U)
+
+
+
+
+
+
+
+
+
+ +

+update

+
+public void update(byte[] U,
+                   int start,
+                   int len)
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.html new file mode 100644 index 00000000..379779ab --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.html @@ -0,0 +1,591 @@ + + + + + + + +PBKDF2Engine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto.PBKDF2 +
+Class PBKDF2Engine

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine
+
+
+
+
public class PBKDF2Engine
extends Object
+ + +

+


+ +

+ + + + + + + + + + + + + + + +
+Field Summary
+protected  PBKDF2Parametersparameters + +
+           
+protected  net.lingala.zip4j.crypto.PBKDF2.PRFprf + +
+           
+  + + + + + + + + + + + + + + + + +
+Constructor Summary
PBKDF2Engine() + +
+           
PBKDF2Engine(PBKDF2Parameters parameters) + +
+           
PBKDF2Engine(PBKDF2Parameters parameters, + net.lingala.zip4j.crypto.PBKDF2.PRF prf) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+protected  void_F(byte[] dest, + int offset, + net.lingala.zip4j.crypto.PBKDF2.PRF prf, + byte[] S, + int c, + int blockIndex) + +
+           
+protected  voidassertPRF(byte[] P) + +
+           
+protected  intceil(int a, + int b) + +
+           
+ byte[]deriveKey(char[] inputPassword) + +
+           
+ byte[]deriveKey(char[] inputPassword, + int dkLen) + +
+           
+ PBKDF2ParametersgetParameters() + +
+           
+ net.lingala.zip4j.crypto.PBKDF2.PRFgetPseudoRandomFunction() + +
+           
+protected  voidINT(byte[] dest, + int offset, + int i) + +
+           
+protected  byte[]PBKDF2(net.lingala.zip4j.crypto.PBKDF2.PRF prf, + byte[] S, + int c, + int dkLen) + +
+           
+ voidsetParameters(PBKDF2Parameters parameters) + +
+           
+ voidsetPseudoRandomFunction(net.lingala.zip4j.crypto.PBKDF2.PRF prf) + +
+           
+ booleanverifyKey(char[] inputPassword) + +
+           
+protected  voidxor(byte[] dest, + byte[] src) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+parameters

+
+protected PBKDF2Parameters parameters
+
+
+
+
+
+ +

+prf

+
+protected net.lingala.zip4j.crypto.PBKDF2.PRF prf
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+PBKDF2Engine

+
+public PBKDF2Engine()
+
+
+
+ +

+PBKDF2Engine

+
+public PBKDF2Engine(PBKDF2Parameters parameters)
+
+
+
+ +

+PBKDF2Engine

+
+public PBKDF2Engine(PBKDF2Parameters parameters,
+                    net.lingala.zip4j.crypto.PBKDF2.PRF prf)
+
+
+ + + + + + + + +
+Method Detail
+ +

+deriveKey

+
+public byte[] deriveKey(char[] inputPassword)
+
+
+
+
+
+
+ +

+deriveKey

+
+public byte[] deriveKey(char[] inputPassword,
+                        int dkLen)
+
+
+
+
+
+
+ +

+verifyKey

+
+public boolean verifyKey(char[] inputPassword)
+
+
+
+
+
+
+ +

+assertPRF

+
+protected void assertPRF(byte[] P)
+
+
+
+
+
+
+ +

+getPseudoRandomFunction

+
+public net.lingala.zip4j.crypto.PBKDF2.PRF getPseudoRandomFunction()
+
+
+
+
+
+
+ +

+PBKDF2

+
+protected byte[] PBKDF2(net.lingala.zip4j.crypto.PBKDF2.PRF prf,
+                        byte[] S,
+                        int c,
+                        int dkLen)
+
+
+
+
+
+
+ +

+ceil

+
+protected int ceil(int a,
+                   int b)
+
+
+
+
+
+
+ +

+_F

+
+protected void _F(byte[] dest,
+                  int offset,
+                  net.lingala.zip4j.crypto.PBKDF2.PRF prf,
+                  byte[] S,
+                  int c,
+                  int blockIndex)
+
+
+
+
+
+
+ +

+xor

+
+protected void xor(byte[] dest,
+                   byte[] src)
+
+
+
+
+
+
+ +

+INT

+
+protected void INT(byte[] dest,
+                   int offset,
+                   int i)
+
+
+
+
+
+
+ +

+getParameters

+
+public PBKDF2Parameters getParameters()
+
+
+
+
+
+
+ +

+setParameters

+
+public void setParameters(PBKDF2Parameters parameters)
+
+
+
+
+
+
+ +

+setPseudoRandomFunction

+
+public void setPseudoRandomFunction(net.lingala.zip4j.crypto.PBKDF2.PRF prf)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.html new file mode 100644 index 00000000..581a44d7 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.html @@ -0,0 +1,574 @@ + + + + + + + +PBKDF2Parameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto.PBKDF2 +
+Class PBKDF2Parameters

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters
+
+
+
+
public class PBKDF2Parameters
extends Object
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+protected  byte[]derivedKey + +
+           
+protected  StringhashAlgorithm + +
+           
+protected  StringhashCharset + +
+           
+protected  intiterationCount + +
+           
+protected  byte[]salt + +
+           
+  + + + + + + + + + + + + + + + + +
+Constructor Summary
PBKDF2Parameters() + +
+           
PBKDF2Parameters(String hashAlgorithm, + String hashCharset, + byte[] salt, + int iterationCount) + +
+           
PBKDF2Parameters(String hashAlgorithm, + String hashCharset, + byte[] salt, + int iterationCount, + byte[] derivedKey) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ byte[]getDerivedKey() + +
+           
+ StringgetHashAlgorithm() + +
+           
+ StringgetHashCharset() + +
+           
+ intgetIterationCount() + +
+           
+ byte[]getSalt() + +
+           
+ voidsetDerivedKey(byte[] derivedKey) + +
+           
+ voidsetHashAlgorithm(String hashAlgorithm) + +
+           
+ voidsetHashCharset(String hashCharset) + +
+           
+ voidsetIterationCount(int iterationCount) + +
+           
+ voidsetSalt(byte[] salt) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+salt

+
+protected byte[] salt
+
+
+
+
+
+ +

+iterationCount

+
+protected int iterationCount
+
+
+
+
+
+ +

+hashAlgorithm

+
+protected String hashAlgorithm
+
+
+
+
+
+ +

+hashCharset

+
+protected String hashCharset
+
+
+
+
+
+ +

+derivedKey

+
+protected byte[] derivedKey
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+PBKDF2Parameters

+
+public PBKDF2Parameters()
+
+
+
+ +

+PBKDF2Parameters

+
+public PBKDF2Parameters(String hashAlgorithm,
+                        String hashCharset,
+                        byte[] salt,
+                        int iterationCount)
+
+
+
+ +

+PBKDF2Parameters

+
+public PBKDF2Parameters(String hashAlgorithm,
+                        String hashCharset,
+                        byte[] salt,
+                        int iterationCount,
+                        byte[] derivedKey)
+
+
+ + + + + + + + +
+Method Detail
+ +

+getIterationCount

+
+public int getIterationCount()
+
+
+
+
+
+
+ +

+setIterationCount

+
+public void setIterationCount(int iterationCount)
+
+
+
+
+
+
+ +

+getSalt

+
+public byte[] getSalt()
+
+
+
+
+
+
+ +

+setSalt

+
+public void setSalt(byte[] salt)
+
+
+
+
+
+
+ +

+getDerivedKey

+
+public byte[] getDerivedKey()
+
+
+
+
+
+
+ +

+setDerivedKey

+
+public void setDerivedKey(byte[] derivedKey)
+
+
+
+
+
+
+ +

+getHashAlgorithm

+
+public String getHashAlgorithm()
+
+
+
+
+
+
+ +

+setHashAlgorithm

+
+public void setHashAlgorithm(String hashAlgorithm)
+
+
+
+
+
+
+ +

+getHashCharset

+
+public String getHashCharset()
+
+
+
+
+
+
+ +

+setHashCharset

+
+public void setHashCharset(String hashCharset)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/MacBasedPRF.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/MacBasedPRF.html new file mode 100644 index 00000000..5b71dc7b --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/MacBasedPRF.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF

+
+No usage of net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/PBKDF2Engine.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/PBKDF2Engine.html new file mode 100644 index 00000000..2b49b2d0 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/PBKDF2Engine.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine

+
+No usage of net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/PBKDF2Parameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/PBKDF2Parameters.html new file mode 100644 index 00000000..d06b461e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/class-use/PBKDF2Parameters.html @@ -0,0 +1,234 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters

+
+ + + + + + + + + +
+Packages that use PBKDF2Parameters
net.lingala.zip4j.crypto.PBKDF2  
+  +

+ + + + + +
+Uses of PBKDF2Parameters in net.lingala.zip4j.crypto.PBKDF2
+  +

+ + + + + + + + + +
Fields in net.lingala.zip4j.crypto.PBKDF2 declared as PBKDF2Parameters
+protected  PBKDF2ParametersPBKDF2Engine.parameters + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.crypto.PBKDF2 that return PBKDF2Parameters
+ PBKDF2ParametersPBKDF2Engine.getParameters() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.crypto.PBKDF2 with parameters of type PBKDF2Parameters
+ voidPBKDF2Engine.setParameters(PBKDF2Parameters parameters) + +
+           
+  +

+ + + + + + + + + + + +
Constructors in net.lingala.zip4j.crypto.PBKDF2 with parameters of type PBKDF2Parameters
PBKDF2Engine(PBKDF2Parameters parameters) + +
+           
PBKDF2Engine(PBKDF2Parameters parameters, + net.lingala.zip4j.crypto.PBKDF2.PRF prf) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-frame.html new file mode 100644 index 00000000..b285581f --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-frame.html @@ -0,0 +1,37 @@ + + + + + + + +net.lingala.zip4j.crypto.PBKDF2 (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.crypto.PBKDF2 + + + + +
+Classes  + +
+MacBasedPRF +
+PBKDF2Engine +
+PBKDF2Parameters
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-summary.html new file mode 100644 index 00000000..ecdd0b6a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-summary.html @@ -0,0 +1,166 @@ + + + + + + + +net.lingala.zip4j.crypto.PBKDF2 (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.crypto.PBKDF2 +

+ + + + + + + + + + + + + + + + + +
+Class Summary
MacBasedPRF 
PBKDF2Engine 
PBKDF2Parameters 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-tree.html new file mode 100644 index 00000000..f35fadfc --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-tree.html @@ -0,0 +1,154 @@ + + + + + + + +net.lingala.zip4j.crypto.PBKDF2 Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.crypto.PBKDF2 +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-use.html new file mode 100644 index 00000000..9299d025 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/PBKDF2/package-use.html @@ -0,0 +1,171 @@ + + + + + + + +Uses of Package net.lingala.zip4j.crypto.PBKDF2 (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.crypto.PBKDF2

+
+ + + + + + + + + +
+Packages that use net.lingala.zip4j.crypto.PBKDF2
net.lingala.zip4j.crypto.PBKDF2  
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.crypto.PBKDF2 used by net.lingala.zip4j.crypto.PBKDF2
PBKDF2Parameters + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/StandardDecrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/StandardDecrypter.html new file mode 100644 index 00000000..a05aa59a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/StandardDecrypter.html @@ -0,0 +1,323 @@ + + + + + + + +StandardDecrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto +
+Class StandardDecrypter

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.StandardDecrypter
+
+
+
All Implemented Interfaces:
IDecrypter
+
+
+
+
public class StandardDecrypter
extends Object
implements IDecrypter
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
StandardDecrypter(FileHeader fileHeader, + byte[] headerBytes) + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intdecryptData(byte[] buff) + +
+           
+ intdecryptData(byte[] buff, + int start, + int len) + +
+           
+ voidinit(byte[] headerBytes) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+StandardDecrypter

+
+public StandardDecrypter(FileHeader fileHeader,
+                         byte[] headerBytes)
+                  throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+decryptData

+
+public int decryptData(byte[] buff)
+                throws ZipException
+
+
+
Specified by:
decryptData in interface IDecrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+decryptData

+
+public int decryptData(byte[] buff,
+                       int start,
+                       int len)
+                throws ZipException
+
+
+
Specified by:
decryptData in interface IDecrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+init

+
+public void init(byte[] headerBytes)
+          throws ZipException
+
+
+
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/StandardEncrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/StandardEncrypter.html new file mode 100644 index 00000000..42b0b344 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/StandardEncrypter.html @@ -0,0 +1,367 @@ + + + + + + + +StandardEncrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto +
+Class StandardEncrypter

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.StandardEncrypter
+
+
+
All Implemented Interfaces:
IEncrypter
+
+
+
+
public class StandardEncrypter
extends Object
implements IEncrypter
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
StandardEncrypter(char[] password, + int crc) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+protected  byteencryptByte(byte val) + +
+           
+ intencryptData(byte[] buff) + +
+           
+ intencryptData(byte[] buff, + int start, + int len) + +
+           
+protected  byte[]generateRandomBytes(int size) + +
+           
+ byte[]getHeaderBytes() + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+StandardEncrypter

+
+public StandardEncrypter(char[] password,
+                         int crc)
+                  throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+encryptData

+
+public int encryptData(byte[] buff)
+                throws ZipException
+
+
+
Specified by:
encryptData in interface IEncrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+encryptData

+
+public int encryptData(byte[] buff,
+                       int start,
+                       int len)
+                throws ZipException
+
+
+
Specified by:
encryptData in interface IEncrypter
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+encryptByte

+
+protected byte encryptByte(byte val)
+
+
+
+
+
+
+
+
+
+ +

+generateRandomBytes

+
+protected byte[] generateRandomBytes(int size)
+                              throws ZipException
+
+
+
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getHeaderBytes

+
+public byte[] getHeaderBytes()
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/AESDecrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/AESDecrypter.html new file mode 100644 index 00000000..62646d73 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/AESDecrypter.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.AESDecrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.AESDecrypter

+
+No usage of net.lingala.zip4j.crypto.AESDecrypter +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/AESEncrpyter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/AESEncrpyter.html new file mode 100644 index 00000000..79639359 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/AESEncrpyter.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.AESEncrpyter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.AESEncrpyter

+
+No usage of net.lingala.zip4j.crypto.AESEncrpyter +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/IDecrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/IDecrypter.html new file mode 100644 index 00000000..d034fc74 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/IDecrypter.html @@ -0,0 +1,263 @@ + + + + + + + +Uses of Interface net.lingala.zip4j.crypto.IDecrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
net.lingala.zip4j.crypto.IDecrypter

+
+ + + + + + + + + + + + + + + + + +
+Packages that use IDecrypter
net.lingala.zip4j.crypto  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
+  +

+ + + + + +
+Uses of IDecrypter in net.lingala.zip4j.crypto
+  +

+ + + + + + + + + + + + + +
Classes in net.lingala.zip4j.crypto that implement IDecrypter
+ classAESDecrypter + +
+           
+ classStandardDecrypter + +
+           
+  +

+ + + + + +
+Uses of IDecrypter in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return IDecrypter
+ IDecrypterUnzipEngineParameters.getIDecryptor() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type IDecrypter
+ voidUnzipEngineParameters.setIDecryptor(IDecrypter decrypter) + +
+           
+  +

+ + + + + +
+Uses of IDecrypter in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.unzip that return IDecrypter
+ IDecrypterUnzipEngine.getDecrypter() + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/IEncrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/IEncrypter.html new file mode 100644 index 00000000..ca389ce6 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/IEncrypter.html @@ -0,0 +1,189 @@ + + + + + + + +Uses of Interface net.lingala.zip4j.crypto.IEncrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
net.lingala.zip4j.crypto.IEncrypter

+
+ + + + + + + + + +
+Packages that use IEncrypter
net.lingala.zip4j.crypto  
+  +

+ + + + + +
+Uses of IEncrypter in net.lingala.zip4j.crypto
+  +

+ + + + + + + + + + + + + +
Classes in net.lingala.zip4j.crypto that implement IEncrypter
+ classAESEncrpyter + +
+           
+ classStandardEncrypter + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/StandardDecrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/StandardDecrypter.html new file mode 100644 index 00000000..1d044eac --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/StandardDecrypter.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.StandardDecrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.StandardDecrypter

+
+No usage of net.lingala.zip4j.crypto.StandardDecrypter +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/StandardEncrypter.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/StandardEncrypter.html new file mode 100644 index 00000000..9d4b1661 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/class-use/StandardEncrypter.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.StandardEncrypter (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.StandardEncrypter

+
+No usage of net.lingala.zip4j.crypto.StandardEncrypter +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/AESEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/AESEngine.html new file mode 100644 index 00000000..02771752 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/AESEngine.html @@ -0,0 +1,321 @@ + + + + + + + +AESEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto.engine +
+Class AESEngine

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.engine.AESEngine
+
+
+
+
public class AESEngine
extends Object
+ + +

+Core Engine for AES Encryption +

+ +

+

+
Author:
+
Srikanth Reddy Lingala
+
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
AESEngine(byte[] key) + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidinit(byte[] key) + +
+           
+ intprocessBlock(byte[] in, + byte[] out) + +
+           
+ intprocessBlock(byte[] in, + int inOff, + byte[] out, + int outOff) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+AESEngine

+
+public AESEngine(byte[] key)
+          throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+init

+
+public void init(byte[] key)
+          throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+processBlock

+
+public int processBlock(byte[] in,
+                        byte[] out)
+                 throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+processBlock

+
+public int processBlock(byte[] in,
+                        int inOff,
+                        byte[] out,
+                        int outOff)
+                 throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.html new file mode 100644 index 00000000..85a90cfe --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.html @@ -0,0 +1,291 @@ + + + + + + + +ZipCryptoEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.crypto.engine +
+Class ZipCryptoEngine

+
+java.lang.Object
+  extended by net.lingala.zip4j.crypto.engine.ZipCryptoEngine
+
+
+
+
public class ZipCryptoEngine
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ZipCryptoEngine() + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ bytedecryptByte() + +
+           
+ voidinitKeys(char[] password) + +
+           
+ voidupdateKeys(byte charAt) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipCryptoEngine

+
+public ZipCryptoEngine()
+
+
+ + + + + + + + +
+Method Detail
+ +

+initKeys

+
+public void initKeys(char[] password)
+
+
+
+
+
+
+ +

+updateKeys

+
+public void updateKeys(byte charAt)
+
+
+
+
+
+
+ +

+decryptByte

+
+public byte decryptByte()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/class-use/AESEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/class-use/AESEngine.html new file mode 100644 index 00000000..d3f0cd84 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/class-use/AESEngine.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.engine.AESEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.engine.AESEngine

+
+No usage of net.lingala.zip4j.crypto.engine.AESEngine +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/class-use/ZipCryptoEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/class-use/ZipCryptoEngine.html new file mode 100644 index 00000000..6eaa21ca --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/class-use/ZipCryptoEngine.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.crypto.engine.ZipCryptoEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.crypto.engine.ZipCryptoEngine

+
+No usage of net.lingala.zip4j.crypto.engine.ZipCryptoEngine +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-frame.html new file mode 100644 index 00000000..b79a1568 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-frame.html @@ -0,0 +1,35 @@ + + + + + + + +net.lingala.zip4j.crypto.engine (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.crypto.engine + + + + +
+Classes  + +
+AESEngine +
+ZipCryptoEngine
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-summary.html new file mode 100644 index 00000000..83e7da26 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-summary.html @@ -0,0 +1,162 @@ + + + + + + + +net.lingala.zip4j.crypto.engine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.crypto.engine +

+ + + + + + + + + + + + + +
+Class Summary
AESEngineCore Engine for AES Encryption
ZipCryptoEngine 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-tree.html new file mode 100644 index 00000000..eb618ccb --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-tree.html @@ -0,0 +1,154 @@ + + + + + + + +net.lingala.zip4j.crypto.engine Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.crypto.engine +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-use.html new file mode 100644 index 00000000..bf506578 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/engine/package-use.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Package net.lingala.zip4j.crypto.engine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.crypto.engine

+
+No usage of net.lingala.zip4j.crypto.engine +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-frame.html new file mode 100644 index 00000000..4a34702b --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-frame.html @@ -0,0 +1,52 @@ + + + + + + + +net.lingala.zip4j.crypto (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.crypto + + + + +
+Interfaces  + +
+IDecrypter +
+IEncrypter
+ + + + + + +
+Classes  + +
+AESDecrypter +
+AESEncrpyter +
+StandardDecrypter +
+StandardEncrypter
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-summary.html new file mode 100644 index 00000000..3a771fec --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-summary.html @@ -0,0 +1,188 @@ + + + + + + + +net.lingala.zip4j.crypto (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.crypto +

+ + + + + + + + + + + + + +
+Interface Summary
IDecrypter 
IEncrypter 
+  + +

+ + + + + + + + + + + + + + + + + + + + + +
+Class Summary
AESDecrypter 
AESEncrpyter 
StandardDecrypter 
StandardEncrypter 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-tree.html new file mode 100644 index 00000000..fd443e10 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-tree.html @@ -0,0 +1,163 @@ + + + + + + + +net.lingala.zip4j.crypto Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.crypto +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-use.html new file mode 100644 index 00000000..c20cab7b --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/crypto/package-use.html @@ -0,0 +1,215 @@ + + + + + + + +Uses of Package net.lingala.zip4j.crypto (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.crypto

+
+ + + + + + + + + + + + + + + + + +
+Packages that use net.lingala.zip4j.crypto
net.lingala.zip4j.crypto  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
+  +

+ + + + + + + + + + + +
+Classes in net.lingala.zip4j.crypto used by net.lingala.zip4j.crypto
IDecrypter + +
+           
IEncrypter + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.crypto used by net.lingala.zip4j.model
IDecrypter + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.crypto used by net.lingala.zip4j.unzip
IDecrypter + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/ZipException.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/ZipException.html new file mode 100644 index 00000000..42b11dcb --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/ZipException.html @@ -0,0 +1,363 @@ + + + + + + + +ZipException (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.exception +
+Class ZipException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by net.lingala.zip4j.exception.ZipException
+
+
+
All Implemented Interfaces:
Serializable
+
+
+
+
public class ZipException
extends Exception
+ + +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Constructor Summary
ZipException() + +
+           
ZipException(String msg) + +
+           
ZipException(String msg, + int code) + +
+           
ZipException(String message, + Throwable cause) + +
+           
ZipException(String message, + Throwable cause, + int code) + +
+           
ZipException(Throwable cause) + +
+           
ZipException(Throwable cause, + int code) + +
+           
+  + + + + + + + + + + + +
+Method Summary
+ intgetCode() + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipException

+
+public ZipException()
+
+
+
+ +

+ZipException

+
+public ZipException(String msg)
+
+
+
+ +

+ZipException

+
+public ZipException(String message,
+                    Throwable cause)
+
+
+
+ +

+ZipException

+
+public ZipException(String msg,
+                    int code)
+
+
+
+ +

+ZipException

+
+public ZipException(String message,
+                    Throwable cause,
+                    int code)
+
+
+
+ +

+ZipException

+
+public ZipException(Throwable cause)
+
+
+
+ +

+ZipException

+
+public ZipException(Throwable cause,
+                    int code)
+
+
+ + + + + + + + +
+Method Detail
+ +

+getCode

+
+public int getCode()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/ZipExceptionConstants.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/ZipExceptionConstants.html new file mode 100644 index 00000000..05ee7e82 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/ZipExceptionConstants.html @@ -0,0 +1,277 @@ + + + + + + + +ZipExceptionConstants (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.exception +
+Interface ZipExceptionConstants

+
+
+
public interface ZipExceptionConstants
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intconstuctorFileNotFoundException + +
+           
+static intinputZipParamIsNull + +
+           
+static intnotZipFile + +
+           
+static intrandomAccessFileNull + +
+           
+static intWRONG_PASSWORD + +
+           
+  +

+ + + + + + + + +
+Field Detail
+ +

+inputZipParamIsNull

+
+static final int inputZipParamIsNull
+
+
+
See Also:
Constant Field Values
+
+
+ +

+constuctorFileNotFoundException

+
+static final int constuctorFileNotFoundException
+
+
+
See Also:
Constant Field Values
+
+
+ +

+randomAccessFileNull

+
+static final int randomAccessFileNull
+
+
+
See Also:
Constant Field Values
+
+
+ +

+notZipFile

+
+static final int notZipFile
+
+
+
See Also:
Constant Field Values
+
+
+ +

+WRONG_PASSWORD

+
+static final int WRONG_PASSWORD
+
+
+
See Also:
Constant Field Values
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/class-use/ZipException.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/class-use/ZipException.html new file mode 100644 index 00000000..51adf29a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/class-use/ZipException.html @@ -0,0 +1,1568 @@ + + + + + + + +Uses of Class net.lingala.zip4j.exception.ZipException (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.exception.ZipException

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use ZipException
net.lingala.zip4j.core  
net.lingala.zip4j.crypto  
net.lingala.zip4j.crypto.engine  
net.lingala.zip4j.io  
net.lingala.zip4j.model  
net.lingala.zip4j.progress  
net.lingala.zip4j.unzip  
net.lingala.zip4j.util  
net.lingala.zip4j.zip  
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.core
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.core that throw ZipException
+ voidZipFile.addFile(File sourceFile, + ZipParameters parameters) + +
+          Adds input source file to the zip file.
+ voidZipFile.addFiles(ArrayList sourceFileList, + ZipParameters parameters) + +
+          Adds the list of input files to the zip file.
+ voidZipFile.addFolder(File path, + ZipParameters parameters) + +
+          Adds the folder in the given file object to the zip file.
+ voidZipFile.addFolder(String path, + ZipParameters parameters) + +
+          Adds the folder in the given path to the zip file.
+ voidZipFile.addStream(InputStream inputStream, + ZipParameters parameters) + +
+          Creates a new entry in the zip file and adds the content of the inputstream to the + zip file.
+ voidZipFile.createZipFile(ArrayList sourceFileList, + ZipParameters parameters) + +
+          Creates a zip file and adds the list of source file(s) to the zip file.
+ voidZipFile.createZipFile(ArrayList sourceFileList, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the list of source file(s) to the zip file.
+ voidZipFile.createZipFile(File sourceFile, + ZipParameters parameters) + +
+          Creates a zip file and adds the source file to the zip file.
+ voidZipFile.createZipFile(File sourceFile, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the source file to the zip file.
+ voidZipFile.createZipFileFromFolder(File folderToAdd, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the files/folders from the specified folder to the zip file.
+ voidZipFile.createZipFileFromFolder(String folderToAdd, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the files/folders from the specified folder to the zip file.
+ voidZipFile.extractAll(String destPath) + +
+          Extracts all the files in the given zip file to the input destination path.
+ voidZipFile.extractAll(String destPath, + UnzipParameters unzipParameters) + +
+          Extracts all the files in the given zip file to the input destination path.
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters, + String newFileName) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(String fileName, + String destPath) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(String fileName, + String destPath, + UnzipParameters unzipParameters) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(String fileName, + String destPath, + UnzipParameters unzipParameters, + String newFileName) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidHeaderWriter.finalizeZipFile(ZipModel zipModel, + OutputStream outputStream) + +
+          Processes zip header data and writes this data to the zip file
+ voidHeaderWriter.finalizeZipFileWithoutValidations(ZipModel zipModel, + OutputStream outputStream) + +
+          Processes zip header data and writes this data to the zip file without any validations.
+ StringZipFile.getComment() + +
+          Returns the comment set for the Zip file
+ StringZipFile.getComment(String encoding) + +
+          Returns the comment set for the Zip file in the input encoding
+ FileHeaderZipFile.getFileHeader(String fileName) + +
+          Returns FileHeader if a file header with the given fileHeader + string exists in the zip model: If not returns null
+ ListZipFile.getFileHeaders() + +
+          Returns the list of file headers in the zip file.
+ ZipInputStreamZipFile.getInputStream(FileHeader fileHeader) + +
+          Returns an input stream for reading the contents of the Zip file corresponding + to the input FileHeader.
+ ArrayListZipFile.getSplitZipFiles() + +
+          Returns the full file path+names of all split zip files + in an ArrayList.
+ booleanZipFile.isEncrypted() + +
+          Checks to see if the zip file is encrypted
+ booleanZipFile.isSplitArchive() + +
+          Checks if the zip file is a split archive
+ voidZipFile.mergeSplitFiles(File outputZipFile) + +
+          Merges split zip files into a single zip file without the need to extract the + files in the archive
+ ZipModelHeaderReader.readAllHeaders() + +
+          Reads all the header information for the zip file.
+ ZipModelHeaderReader.readAllHeaders(String fileNameCharset) + +
+          Reads all the header information for the zip file.
+ LocalFileHeaderHeaderReader.readLocalFileHeader(FileHeader fileHeader) + +
+          Reads local file header for the given file header
+ voidZipFile.removeFile(FileHeader fileHeader) + +
+          Removes the file provided in the input file header from the zip file.
+ voidZipFile.removeFile(String fileName) + +
+          Removes the file provided in the input paramters from the zip file.
+ voidZipFile.setComment(String comment) + +
+          Sets comment for the Zip file
+ voidZipFile.setFileNameCharset(String charsetName) + +
+          Zip4j will encode all the file names with the input charset.
+ voidZipFile.setPassword(char[] password) + +
+          Sets the password for the zip file
+ voidZipFile.setPassword(String password) + +
+          Sets the password for the zip file.
+ Note: For security reasons, usage of this method is discouraged.
+ voidHeaderWriter.updateLocalFileHeader(LocalFileHeader localFileHeader, + long offset, + int toUpdate, + ZipModel zipModel, + byte[] bytesToWrite, + int noOfDisk, + SplitOutputStream outputStream) + +
+           
+ intHeaderWriter.writeExtendedLocalHeader(LocalFileHeader localFileHeader, + OutputStream outputStream) + +
+           
+ intHeaderWriter.writeLocalFileHeader(ZipModel zipModel, + LocalFileHeader localFileHeader, + OutputStream outputStream) + +
+           
+  +

+ + + + + + + + + + + +
Constructors in net.lingala.zip4j.core that throw ZipException
ZipFile(File zipFile) + +
+          Creates a new Zip File Object with the input file.
ZipFile(String zipFile) + +
+          Creates a new Zip File Object with the given zip file path.
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.crypto
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.crypto that throw ZipException
+ intStandardDecrypter.decryptData(byte[] buff) + +
+           
+ intIDecrypter.decryptData(byte[] buff) + +
+           
+ intAESDecrypter.decryptData(byte[] buff) + +
+           
+ intStandardDecrypter.decryptData(byte[] buff, + int start, + int len) + +
+           
+ intIDecrypter.decryptData(byte[] buff, + int start, + int len) + +
+           
+ intAESDecrypter.decryptData(byte[] buff, + int start, + int len) + +
+           
+ intStandardEncrypter.encryptData(byte[] buff) + +
+           
+ intIEncrypter.encryptData(byte[] buff) + +
+           
+ intAESEncrpyter.encryptData(byte[] buff) + +
+           
+ intStandardEncrypter.encryptData(byte[] buff, + int start, + int len) + +
+           
+ intIEncrypter.encryptData(byte[] buff, + int start, + int len) + +
+           
+ intAESEncrpyter.encryptData(byte[] buff, + int start, + int len) + +
+           
+protected  byte[]StandardEncrypter.generateRandomBytes(int size) + +
+           
+ voidStandardDecrypter.init(byte[] headerBytes) + +
+           
+  +

+ + + + + + + + + + + + + + + + + +
Constructors in net.lingala.zip4j.crypto that throw ZipException
AESDecrypter(LocalFileHeader localFileHeader, + byte[] salt, + byte[] passwordVerifier) + +
+           
AESEncrpyter(char[] password, + int keyStrength) + +
+           
StandardDecrypter(FileHeader fileHeader, + byte[] headerBytes) + +
+           
StandardEncrypter(char[] password, + int crc) + +
+           
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.crypto.engine
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.crypto.engine that throw ZipException
+ voidAESEngine.init(byte[] key) + +
+           
+ intAESEngine.processBlock(byte[] in, + byte[] out) + +
+           
+ intAESEngine.processBlock(byte[] in, + int inOff, + byte[] out, + int outOff) + +
+           
+  +

+ + + + + + + + +
Constructors in net.lingala.zip4j.crypto.engine that throw ZipException
AESEngine(byte[] key) + +
+           
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.io
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.io that throw ZipException
+ booleanSplitOutputStream.checkBuffSizeAndStartNextSplitFile(int bufferSize) + +
+          Checks if the buffer size is sufficient for the current split file.
+ voidDeflaterOutputStream.closeEntry() + +
+           
+ voidCipherOutputStream.closeEntry() + +
+           
+ voidDeflaterOutputStream.finish() + +
+           
+ voidCipherOutputStream.finish() + +
+           
+ booleanSplitOutputStream.isBuffSizeFitForCurrSplitFile(int bufferSize) + +
+          Checks if the given buffer size will be fit in the current split file.
+ voidDeflaterOutputStream.putNextEntry(File file, + ZipParameters zipParameters) + +
+           
+ voidCipherOutputStream.putNextEntry(File file, + ZipParameters zipParameters) + +
+           
+  +

+ + + + + + + + + + + + + + + + + +
Constructors in net.lingala.zip4j.io that throw ZipException
SplitOutputStream(File file) + +
+           
SplitOutputStream(File file, + long splitLength) + +
+           
SplitOutputStream(String name) + +
+           
SplitOutputStream(String name, + long splitLength) + +
+           
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.model
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model that throw ZipException
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters.
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.progress
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.progress that throw ZipException
+ voidProgressMonitor.endProgressMonitorError(Throwable e) + +
+           
+ voidProgressMonitor.endProgressMonitorSuccess() + +
+           
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.unzip that throw ZipException
+static voidUnzipUtil.applyFileAttributes(FileHeader fileHeader, + File file) + +
+           
+static voidUnzipUtil.applyFileAttributes(FileHeader fileHeader, + File file, + UnzipParameters unzipParameters) + +
+           
+ voidUnzipEngine.checkCRC() + +
+           
+ voidUnzip.extractAll(UnzipParameters unzipParameters, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidUnzip.extractFile(FileHeader fileHeader, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ ZipInputStreamUnzipEngine.getInputStream() + +
+           
+ ZipInputStreamUnzip.getInputStream(FileHeader fileHeader) + +
+           
+ voidUnzipEngine.unzipFile(ProgressMonitor progressMonitor, + String outPath, + String newFileName, + UnzipParameters unzipParameters) + +
+           
+  +

+ + + + + + + + + + + +
Constructors in net.lingala.zip4j.unzip that throw ZipException
Unzip(ZipModel zipModel) + +
+           
UnzipEngine(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.util
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.util that throw ZipException
+static byteRaw.bitArrayToByte(int[] bitArray) + +
+           
+static booleanZip4jUtil.checkArrayListTypes(ArrayList sourceList, + int type) + +
+          Checks to see if all the elements in the arraylist match the given type
+static booleanZip4jUtil.checkFileExists(File file) + +
+           
+static booleanZip4jUtil.checkFileExists(String path) + +
+           
+static booleanZip4jUtil.checkFileReadAccess(String path) + +
+           
+static booleanZip4jUtil.checkFileWriteAccess(String path) + +
+           
+static booleanZip4jUtil.checkOutputFolder(String path) + +
+           
+static longCRCUtil.computeFileCRC(String inputFile) + +
+           
+static longCRCUtil.computeFileCRC(String inputFile, + ProgressMonitor progressMonitor) + +
+          Calculates CRC of a file
+static byte[]Zip4jUtil.convertCharset(String str) + +
+           
+static StringZip4jUtil.detectCharSet(String str) + +
+          Detects the encoding charset for the input string
+static StringZip4jUtil.getAbsoluteFilePath(String filePath) + +
+          Returns an absoulte path for the given file path
+static intZip4jUtil.getEncodedStringLength(String str) + +
+          returns the length of the string by wrapping it in a byte buffer with + the appropriate charset of the input string and returns the limit of the + byte buffer
+static intZip4jUtil.getEncodedStringLength(String str, + String charset) + +
+          returns the length of the string in the input encoding
+static FileHeaderZip4jUtil.getFileHeader(ZipModel zipModel, + String fileName) + +
+           
+static FileHeaderZip4jUtil.getFileHeaderWithExactMatch(ZipModel zipModel, + String fileName) + +
+           
+static longZip4jUtil.getFileLengh(File file) + +
+           
+static longZip4jUtil.getFileLengh(String file) + +
+           
+static StringZip4jUtil.getFileNameFromFilePath(File file) + +
+           
+static ArrayListZip4jUtil.getFilesInDirectoryRec(File path, + boolean readHiddenFiles) + +
+           
+static intZip4jUtil.getIndexOfFileHeader(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+static longZip4jUtil.getLastModifiedFileTime(File file, + TimeZone timeZone) + +
+           
+static StringZip4jUtil.getRelativeFileName(String file, + String rootFolderInZip, + String rootFolderPath) + +
+           
+static ArrayListZip4jUtil.getSplitZipFiles(ZipModel zipModel) + +
+           
+static StringZip4jUtil.getZipFileNameWithoutExt(String zipFile) + +
+           
+ voidArchiveMaintainer.initProgressMonitorForMergeOp(ZipModel zipModel, + ProgressMonitor progressMonitor) + +
+           
+ voidArchiveMaintainer.initProgressMonitorForRemoveOp(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ HashMapArchiveMaintainer.initRemoveZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+static booleanZip4jUtil.isSupportedCharset(String charset) + +
+          Checks if the input charset is supported
+ voidArchiveMaintainer.mergeSplitZipFiles(ZipModel zipModel, + File outputZipFile, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Merges split Zip files into a single Zip file
+static intRaw.readLeInt(DataInput di, + byte[] b) + +
+           
+ HashMapArchiveMaintainer.removeZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidArchiveMaintainer.setComment(ZipModel zipModel, + String comment) + +
+           
+static voidZip4jUtil.setFileArchive(File file) + +
+           
+static voidZip4jUtil.setFileHidden(File file) + +
+           
+static voidZip4jUtil.setFileReadOnly(File file) + +
+           
+static voidZip4jUtil.setFileSystemMode(File file) + +
+           
+  +

+ + + + + +
+Uses of ZipException in net.lingala.zip4j.zip
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.zip that throw ZipException
+ voidZipEngine.addFiles(ArrayList fileList, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidZipEngine.addFolderToZip(File file, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidZipEngine.addStreamToZip(InputStream inputStream, + ZipParameters parameters) + +
+           
+  +

+ + + + + + + + +
Constructors in net.lingala.zip4j.zip that throw ZipException
ZipEngine(ZipModel zipModel) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/class-use/ZipExceptionConstants.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/class-use/ZipExceptionConstants.html new file mode 100644 index 00000000..b1230f78 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/class-use/ZipExceptionConstants.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Interface net.lingala.zip4j.exception.ZipExceptionConstants (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
net.lingala.zip4j.exception.ZipExceptionConstants

+
+No usage of net.lingala.zip4j.exception.ZipExceptionConstants +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-frame.html new file mode 100644 index 00000000..f9259e33 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-frame.html @@ -0,0 +1,44 @@ + + + + + + + +net.lingala.zip4j.exception (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.exception + + + + +
+Interfaces  + +
+ZipExceptionConstants
+ + + + + + +
+Exceptions  + +
+ZipException
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-summary.html new file mode 100644 index 00000000..d1168f02 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-summary.html @@ -0,0 +1,172 @@ + + + + + + + +net.lingala.zip4j.exception (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.exception +

+ + + + + + + + + +
+Interface Summary
ZipExceptionConstants 
+  + +

+ + + + + + + + + +
+Exception Summary
ZipException 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-tree.html new file mode 100644 index 00000000..578e6a75 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-tree.html @@ -0,0 +1,164 @@ + + + + + + + +net.lingala.zip4j.exception Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.exception +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-use.html new file mode 100644 index 00000000..cfecd2a1 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/exception/package-use.html @@ -0,0 +1,323 @@ + + + + + + + +Uses of Package net.lingala.zip4j.exception (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.exception

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use net.lingala.zip4j.exception
net.lingala.zip4j.core  
net.lingala.zip4j.crypto  
net.lingala.zip4j.crypto.engine  
net.lingala.zip4j.io  
net.lingala.zip4j.model  
net.lingala.zip4j.progress  
net.lingala.zip4j.unzip  
net.lingala.zip4j.util  
net.lingala.zip4j.zip  
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.core
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.crypto
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.crypto.engine
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.io
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.model
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.progress
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.unzip
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.util
ZipException + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.exception used by net.lingala.zip4j.zip
ZipException + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/BaseInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/BaseInputStream.html new file mode 100644 index 00000000..786fb8fe --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/BaseInputStream.html @@ -0,0 +1,341 @@ + + + + + + + +BaseInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class BaseInputStream

+
+java.lang.Object
+  extended by java.io.InputStream
+      extended by net.lingala.zip4j.io.BaseInputStream
+
+
+
All Implemented Interfaces:
Closeable
+
+
+
Direct Known Subclasses:
PartInputStream
+
+
+
+
public abstract class BaseInputStream
extends InputStream
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
BaseInputStream() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intavailable() + +
+           
+ UnzipEnginegetUnzipEngine() + +
+           
+ intread() + +
+           
+ voidseek(long pos) + +
+           
+ + + + + + + +
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, read, reset, skip
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+BaseInputStream

+
+public BaseInputStream()
+
+
+ + + + + + + + +
+Method Detail
+ +

+read

+
+public int read()
+         throws IOException
+
+
+
Specified by:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+seek

+
+public void seek(long pos)
+          throws IOException
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+available

+
+public int available()
+              throws IOException
+
+
+
Overrides:
available in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+getUnzipEngine

+
+public UnzipEngine getUnzipEngine()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/BaseOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/BaseOutputStream.html new file mode 100644 index 00000000..3ecb5c70 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/BaseOutputStream.html @@ -0,0 +1,275 @@ + + + + + + + +BaseOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class BaseOutputStream

+
+java.lang.Object
+  extended by java.io.OutputStream
+      extended by net.lingala.zip4j.io.BaseOutputStream
+
+
+
All Implemented Interfaces:
Closeable, Flushable
+
+
+
Direct Known Subclasses:
CipherOutputStream
+
+
+
+
public abstract class BaseOutputStream
extends OutputStream
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
BaseOutputStream() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+ voidwrite(int b) + +
+           
+ + + + + + + +
Methods inherited from class java.io.OutputStream
close, flush, write, write
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+BaseOutputStream

+
+public BaseOutputStream()
+
+
+ + + + + + + + +
+Method Detail
+ +

+write

+
+public void write(int b)
+           throws IOException
+
+
+
Specified by:
write in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/CipherOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/CipherOutputStream.html new file mode 100644 index 00000000..87d8c1f4 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/CipherOutputStream.html @@ -0,0 +1,631 @@ + + + + + + + +CipherOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class CipherOutputStream

+
+java.lang.Object
+  extended by java.io.OutputStream
+      extended by net.lingala.zip4j.io.BaseOutputStream
+          extended by net.lingala.zip4j.io.CipherOutputStream
+
+
+
All Implemented Interfaces:
Closeable, Flushable
+
+
+
Direct Known Subclasses:
DeflaterOutputStream
+
+
+
+
public class CipherOutputStream
extends BaseOutputStream
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+protected  CRC32crc + +
+           
+protected  FileHeaderfileHeader + +
+           
+protected  LocalFileHeaderlocalFileHeader + +
+           
+protected  OutputStreamoutputStream + +
+           
+protected  ZipModelzipModel + +
+           
+protected  ZipParameterszipParameters + +
+           
+  + + + + + + + + + + +
+Constructor Summary
CipherOutputStream(OutputStream outputStream, + ZipModel zipModel) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidclose() + +
+           
+ voidcloseEntry() + +
+           
+ voiddecrementCompressedFileSize(int value) + +
+           
+ voidfinish() + +
+           
+ FilegetSourceFile() + +
+           
+ voidputNextEntry(File file, + ZipParameters zipParameters) + +
+           
+ voidsetSourceFile(File sourceFile) + +
+           
+protected  voidupdateTotalBytesRead(int toUpdate) + +
+           
+ voidwrite(byte[] b) + +
+           
+ voidwrite(byte[] b, + int off, + int len) + +
+           
+ voidwrite(int bval) + +
+           
+ + + + + + + +
Methods inherited from class java.io.OutputStream
flush
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+outputStream

+
+protected OutputStream outputStream
+
+
+
+
+
+ +

+fileHeader

+
+protected FileHeader fileHeader
+
+
+
+
+
+ +

+localFileHeader

+
+protected LocalFileHeader localFileHeader
+
+
+
+
+
+ +

+zipParameters

+
+protected ZipParameters zipParameters
+
+
+
+
+
+ +

+zipModel

+
+protected ZipModel zipModel
+
+
+
+
+
+ +

+crc

+
+protected CRC32 crc
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+CipherOutputStream

+
+public CipherOutputStream(OutputStream outputStream,
+                          ZipModel zipModel)
+
+
+ + + + + + + + +
+Method Detail
+ +

+putNextEntry

+
+public void putNextEntry(File file,
+                         ZipParameters zipParameters)
+                  throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+write

+
+public void write(int bval)
+           throws IOException
+
+
+
Overrides:
write in class BaseOutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(byte[] b)
+           throws IOException
+
+
+
Overrides:
write in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(byte[] b,
+                  int off,
+                  int len)
+           throws IOException
+
+
+
Overrides:
write in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+closeEntry

+
+public void closeEntry()
+                throws IOException,
+                       ZipException
+
+
+ +
Throws: +
IOException +
ZipException
+
+
+
+ +

+finish

+
+public void finish()
+            throws IOException,
+                   ZipException
+
+
+ +
Throws: +
IOException +
ZipException
+
+
+
+ +

+close

+
+public void close()
+           throws IOException
+
+
+
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+decrementCompressedFileSize

+
+public void decrementCompressedFileSize(int value)
+
+
+
+
+
+
+ +

+updateTotalBytesRead

+
+protected void updateTotalBytesRead(int toUpdate)
+
+
+
+
+
+
+ +

+setSourceFile

+
+public void setSourceFile(File sourceFile)
+
+
+
+
+
+
+ +

+getSourceFile

+
+public File getSourceFile()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/DeflaterOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/DeflaterOutputStream.html new file mode 100644 index 00000000..b6628607 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/DeflaterOutputStream.html @@ -0,0 +1,468 @@ + + + + + + + +DeflaterOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class DeflaterOutputStream

+
+java.lang.Object
+  extended by java.io.OutputStream
+      extended by net.lingala.zip4j.io.BaseOutputStream
+          extended by net.lingala.zip4j.io.CipherOutputStream
+              extended by net.lingala.zip4j.io.DeflaterOutputStream
+
+
+
All Implemented Interfaces:
Closeable, Flushable
+
+
+
Direct Known Subclasses:
ZipOutputStream
+
+
+
+
public class DeflaterOutputStream
extends CipherOutputStream
+ + +

+


+ +

+ + + + + + + + + + + +
+Field Summary
+protected  Deflaterdeflater + +
+           
+ + + + + + + +
Fields inherited from class net.lingala.zip4j.io.CipherOutputStream
crc, fileHeader, localFileHeader, outputStream, zipModel, zipParameters
+  + + + + + + + + + + +
+Constructor Summary
DeflaterOutputStream(OutputStream outputStream, + ZipModel zipModel) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidcloseEntry() + +
+           
+ voidfinish() + +
+           
+ voidputNextEntry(File file, + ZipParameters zipParameters) + +
+           
+ voidwrite(byte[] b) + +
+           
+ voidwrite(byte[] buf, + int off, + int len) + +
+           
+ voidwrite(int bval) + +
+           
+ + + + + + + +
Methods inherited from class net.lingala.zip4j.io.CipherOutputStream
close, decrementCompressedFileSize, getSourceFile, setSourceFile, updateTotalBytesRead
+ + + + + + + +
Methods inherited from class java.io.OutputStream
flush
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+deflater

+
+protected Deflater deflater
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+DeflaterOutputStream

+
+public DeflaterOutputStream(OutputStream outputStream,
+                            ZipModel zipModel)
+
+
+ + + + + + + + +
+Method Detail
+ +

+putNextEntry

+
+public void putNextEntry(File file,
+                         ZipParameters zipParameters)
+                  throws ZipException
+
+
+
Overrides:
putNextEntry in class CipherOutputStream
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+write

+
+public void write(byte[] b)
+           throws IOException
+
+
+
Overrides:
write in class CipherOutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(int bval)
+           throws IOException
+
+
+
Overrides:
write in class CipherOutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(byte[] buf,
+                  int off,
+                  int len)
+           throws IOException
+
+
+
Overrides:
write in class CipherOutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+closeEntry

+
+public void closeEntry()
+                throws IOException,
+                       ZipException
+
+
+
Overrides:
closeEntry in class CipherOutputStream
+
+
+ +
Throws: +
IOException +
ZipException
+
+
+
+ +

+finish

+
+public void finish()
+            throws IOException,
+                   ZipException
+
+
+
Overrides:
finish in class CipherOutputStream
+
+
+ +
Throws: +
IOException +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/InflaterInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/InflaterInputStream.html new file mode 100644 index 00000000..acb31497 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/InflaterInputStream.html @@ -0,0 +1,465 @@ + + + + + + + +InflaterInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class InflaterInputStream

+
+java.lang.Object
+  extended by java.io.InputStream
+      extended by net.lingala.zip4j.io.BaseInputStream
+          extended by net.lingala.zip4j.io.PartInputStream
+              extended by net.lingala.zip4j.io.InflaterInputStream
+
+
+
All Implemented Interfaces:
Closeable
+
+
+
+
public class InflaterInputStream
extends PartInputStream
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
InflaterInputStream(RandomAccessFile raf, + long start, + long len, + UnzipEngine unzipEngine) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intavailable() + +
+          Returns 0 after EOF has been reached, otherwise always return 1.
+ voidclose() + +
+           
+ UnzipEnginegetUnzipEngine() + +
+           
+ intread() + +
+           
+ intread(byte[] b) + +
+           
+ intread(byte[] b, + int off, + int len) + +
+           
+ voidseek(long pos) + +
+           
+ longskip(long n) + +
+          Skips specified number of bytes of uncompressed data.
+ + + + + + + +
Methods inherited from class java.io.InputStream
mark, markSupported, reset
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+InflaterInputStream

+
+public InflaterInputStream(RandomAccessFile raf,
+                           long start,
+                           long len,
+                           UnzipEngine unzipEngine)
+
+
+ + + + + + + + +
+Method Detail
+ +

+read

+
+public int read()
+         throws IOException
+
+
+
Overrides:
read in class PartInputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+read

+
+public int read(byte[] b)
+         throws IOException
+
+
+
Overrides:
read in class PartInputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+read

+
+public int read(byte[] b,
+                int off,
+                int len)
+         throws IOException
+
+
+
Overrides:
read in class PartInputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+skip

+
+public long skip(long n)
+          throws IOException
+
+
Skips specified number of bytes of uncompressed data. +

+

+
Overrides:
skip in class PartInputStream
+
+
+
Parameters:
n - the number of bytes to skip +
Returns:
the actual number of bytes skipped. +
Throws: +
IOException - if an I/O error has occurred +
IllegalArgumentException - if n < 0
+
+
+
+ +

+seek

+
+public void seek(long pos)
+          throws IOException
+
+
+
Overrides:
seek in class PartInputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+available

+
+public int available()
+
+
Returns 0 after EOF has been reached, otherwise always return 1. +

+ Programs should not count on this method to return the actual number + of bytes that could be read without blocking. +

+

+
Overrides:
available in class PartInputStream
+
+
+ +
Returns:
1 before EOF and 0 after EOF. +
Throws: +
IOException - if an I/O error occurs.
+
+
+
+ +

+close

+
+public void close()
+           throws IOException
+
+
+
Specified by:
close in interface Closeable
Overrides:
close in class PartInputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+getUnzipEngine

+
+public UnzipEngine getUnzipEngine()
+
+
+
Overrides:
getUnzipEngine in class PartInputStream
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/PartInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/PartInputStream.html new file mode 100644 index 00000000..44db3a3e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/PartInputStream.html @@ -0,0 +1,455 @@ + + + + + + + +PartInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class PartInputStream

+
+java.lang.Object
+  extended by java.io.InputStream
+      extended by net.lingala.zip4j.io.BaseInputStream
+          extended by net.lingala.zip4j.io.PartInputStream
+
+
+
All Implemented Interfaces:
Closeable
+
+
+
Direct Known Subclasses:
InflaterInputStream
+
+
+
+
public class PartInputStream
extends BaseInputStream
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
PartInputStream(RandomAccessFile raf, + long start, + long len, + UnzipEngine unzipEngine) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intavailable() + +
+           
+ voidclose() + +
+           
+ UnzipEnginegetUnzipEngine() + +
+           
+ intread() + +
+           
+ intread(byte[] b) + +
+           
+ intread(byte[] b, + int off, + int len) + +
+           
+ voidseek(long pos) + +
+           
+ longskip(long amount) + +
+           
+ + + + + + + +
Methods inherited from class java.io.InputStream
mark, markSupported, reset
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+PartInputStream

+
+public PartInputStream(RandomAccessFile raf,
+                       long start,
+                       long len,
+                       UnzipEngine unzipEngine)
+
+
+ + + + + + + + +
+Method Detail
+ +

+available

+
+public int available()
+
+
+
Overrides:
available in class BaseInputStream
+
+
+
+
+
+
+ +

+read

+
+public int read()
+         throws IOException
+
+
+
Overrides:
read in class BaseInputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+read

+
+public int read(byte[] b)
+         throws IOException
+
+
+
Overrides:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+read

+
+public int read(byte[] b,
+                int off,
+                int len)
+         throws IOException
+
+
+
Overrides:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+skip

+
+public long skip(long amount)
+          throws IOException
+
+
+
Overrides:
skip in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+close

+
+public void close()
+           throws IOException
+
+
+
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+seek

+
+public void seek(long pos)
+          throws IOException
+
+
+
Overrides:
seek in class BaseInputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+getUnzipEngine

+
+public UnzipEngine getUnzipEngine()
+
+
+
Overrides:
getUnzipEngine in class BaseInputStream
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/SplitOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/SplitOutputStream.html new file mode 100644 index 00000000..502bb7f0 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/SplitOutputStream.html @@ -0,0 +1,594 @@ + + + + + + + +SplitOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class SplitOutputStream

+
+java.lang.Object
+  extended by java.io.OutputStream
+      extended by net.lingala.zip4j.io.SplitOutputStream
+
+
+
All Implemented Interfaces:
Closeable, Flushable
+
+
+
+
public class SplitOutputStream
extends OutputStream
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + + +
+Constructor Summary
SplitOutputStream(File file) + +
+           
SplitOutputStream(File file, + long splitLength) + +
+           
SplitOutputStream(String name) + +
+           
SplitOutputStream(String name, + long splitLength) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleancheckBuffSizeAndStartNextSplitFile(int bufferSize) + +
+          Checks if the buffer size is sufficient for the current split file.
+ voidclose() + +
+           
+ voidflush() + +
+           
+ intgetCurrSplitFileCounter() + +
+           
+ longgetFilePointer() + +
+           
+ longgetSplitLength() + +
+           
+ booleanisBuffSizeFitForCurrSplitFile(int bufferSize) + +
+          Checks if the given buffer size will be fit in the current split file.
+ booleanisSplitZipFile() + +
+           
+ voidseek(long pos) + +
+           
+ voidwrite(byte[] b) + +
+           
+ voidwrite(byte[] b, + int off, + int len) + +
+           
+ voidwrite(int b) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+SplitOutputStream

+
+public SplitOutputStream(String name)
+                  throws FileNotFoundException,
+                         ZipException
+
+
+ +
Throws: +
FileNotFoundException +
ZipException
+
+
+ +

+SplitOutputStream

+
+public SplitOutputStream(File file)
+                  throws FileNotFoundException,
+                         ZipException
+
+
+ +
Throws: +
FileNotFoundException +
ZipException
+
+
+ +

+SplitOutputStream

+
+public SplitOutputStream(String name,
+                         long splitLength)
+                  throws FileNotFoundException,
+                         ZipException
+
+
+ +
Throws: +
FileNotFoundException +
ZipException
+
+
+ +

+SplitOutputStream

+
+public SplitOutputStream(File file,
+                         long splitLength)
+                  throws FileNotFoundException,
+                         ZipException
+
+
+ +
Throws: +
FileNotFoundException +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+write

+
+public void write(int b)
+           throws IOException
+
+
+
Specified by:
write in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(byte[] b)
+           throws IOException
+
+
+
Overrides:
write in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(byte[] b,
+                  int off,
+                  int len)
+           throws IOException
+
+
+
Overrides:
write in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+checkBuffSizeAndStartNextSplitFile

+
+public boolean checkBuffSizeAndStartNextSplitFile(int bufferSize)
+                                           throws ZipException
+
+
Checks if the buffer size is sufficient for the current split file. If not + a new split file will be started. +

+

+
Parameters:
bufferSize - +
Returns:
true if a new split file was started else false +
Throws: +
ZipException
+
+
+
+ +

+isBuffSizeFitForCurrSplitFile

+
+public boolean isBuffSizeFitForCurrSplitFile(int bufferSize)
+                                      throws ZipException
+
+
Checks if the given buffer size will be fit in the current split file. + If this output stream is a non-split file, then this method always returns true +

+

+
Parameters:
bufferSize - +
Returns:
true if the buffer size is fit in the current split file or else false. +
Throws: +
ZipException
+
+
+
+ +

+seek

+
+public void seek(long pos)
+          throws IOException
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+close

+
+public void close()
+           throws IOException
+
+
+
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+flush

+
+public void flush()
+           throws IOException
+
+
+
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+getFilePointer

+
+public long getFilePointer()
+                    throws IOException
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+isSplitZipFile

+
+public boolean isSplitZipFile()
+
+
+
+
+
+
+ +

+getSplitLength

+
+public long getSplitLength()
+
+
+
+
+
+
+ +

+getCurrSplitFileCounter

+
+public int getCurrSplitFileCounter()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/ZipInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/ZipInputStream.html new file mode 100644 index 00000000..6c01c259 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/ZipInputStream.html @@ -0,0 +1,431 @@ + + + + + + + +ZipInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class ZipInputStream

+
+java.lang.Object
+  extended by java.io.InputStream
+      extended by net.lingala.zip4j.io.ZipInputStream
+
+
+
All Implemented Interfaces:
Closeable
+
+
+
+
public class ZipInputStream
extends InputStream
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ZipInputStream(BaseInputStream is) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intavailable() + +
+           
+ voidclose() + +
+          Closes the input stream and releases any resources.
+ voidclose(boolean skipCRCCheck) + +
+          Closes the input stream and releases any resources.
+ intread() + +
+           
+ intread(byte[] b) + +
+           
+ intread(byte[] b, + int off, + int len) + +
+           
+ longskip(long n) + +
+           
+ + + + + + + +
Methods inherited from class java.io.InputStream
mark, markSupported, reset
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipInputStream

+
+public ZipInputStream(BaseInputStream is)
+
+
+ + + + + + + + +
+Method Detail
+ +

+read

+
+public int read()
+         throws IOException
+
+
+
Specified by:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+read

+
+public int read(byte[] b)
+         throws IOException
+
+
+
Overrides:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+read

+
+public int read(byte[] b,
+                int off,
+                int len)
+         throws IOException
+
+
+
Overrides:
read in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+close

+
+public void close()
+           throws IOException
+
+
Closes the input stream and releases any resources. + This method also checks for the CRC of the extracted file. + If CRC check has to be skipped use close(boolean skipCRCCheck) method +

+

+
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+close

+
+public void close(boolean skipCRCCheck)
+           throws IOException
+
+
Closes the input stream and releases any resources. + If skipCRCCheck flag is set to true, this method skips CRC Check + of the extracted file +

+

+ +
Throws: +
IOException
+
+
+
+ +

+available

+
+public int available()
+              throws IOException
+
+
+
Overrides:
available in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+skip

+
+public long skip(long n)
+          throws IOException
+
+
+
Overrides:
skip in class InputStream
+
+
+ +
Throws: +
IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/ZipOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/ZipOutputStream.html new file mode 100644 index 00000000..a7d77058 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/ZipOutputStream.html @@ -0,0 +1,390 @@ + + + + + + + +ZipOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.io +
+Class ZipOutputStream

+
+java.lang.Object
+  extended by java.io.OutputStream
+      extended by net.lingala.zip4j.io.BaseOutputStream
+          extended by net.lingala.zip4j.io.CipherOutputStream
+              extended by net.lingala.zip4j.io.DeflaterOutputStream
+                  extended by net.lingala.zip4j.io.ZipOutputStream
+
+
+
All Implemented Interfaces:
Closeable, Flushable
+
+
+
+
public class ZipOutputStream
extends DeflaterOutputStream
+ + +

+


+ +

+ + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class net.lingala.zip4j.io.DeflaterOutputStream
deflater
+ + + + + + + +
Fields inherited from class net.lingala.zip4j.io.CipherOutputStream
crc, fileHeader, localFileHeader, outputStream, zipModel, zipParameters
+  + + + + + + + + + + + + + +
+Constructor Summary
ZipOutputStream(OutputStream outputStream) + +
+           
ZipOutputStream(OutputStream outputStream, + ZipModel zipModel) + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidwrite(byte[] b) + +
+           
+ voidwrite(byte[] b, + int off, + int len) + +
+           
+ voidwrite(int bval) + +
+           
+ + + + + + + +
Methods inherited from class net.lingala.zip4j.io.DeflaterOutputStream
closeEntry, finish, putNextEntry
+ + + + + + + +
Methods inherited from class net.lingala.zip4j.io.CipherOutputStream
close, decrementCompressedFileSize, getSourceFile, setSourceFile, updateTotalBytesRead
+ + + + + + + +
Methods inherited from class java.io.OutputStream
flush
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipOutputStream

+
+public ZipOutputStream(OutputStream outputStream)
+
+
+
+ +

+ZipOutputStream

+
+public ZipOutputStream(OutputStream outputStream,
+                       ZipModel zipModel)
+
+
+ + + + + + + + +
+Method Detail
+ +

+write

+
+public void write(int bval)
+           throws IOException
+
+
+
Overrides:
write in class DeflaterOutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(byte[] b)
+           throws IOException
+
+
+
Overrides:
write in class DeflaterOutputStream
+
+
+ +
Throws: +
IOException
+
+
+
+ +

+write

+
+public void write(byte[] b,
+                  int off,
+                  int len)
+           throws IOException
+
+
+
Overrides:
write in class DeflaterOutputStream
+
+
+ +
Throws: +
IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/BaseInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/BaseInputStream.html new file mode 100644 index 00000000..f7293130 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/BaseInputStream.html @@ -0,0 +1,203 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.BaseInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.BaseInputStream

+
+ + + + + + + + + +
+Packages that use BaseInputStream
net.lingala.zip4j.io  
+  +

+ + + + + +
+Uses of BaseInputStream in net.lingala.zip4j.io
+  +

+ + + + + + + + + + + + + +
Subclasses of BaseInputStream in net.lingala.zip4j.io
+ classInflaterInputStream + +
+           
+ classPartInputStream + +
+           
+  +

+ + + + + + + + +
Constructors in net.lingala.zip4j.io with parameters of type BaseInputStream
ZipInputStream(BaseInputStream is) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/BaseOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/BaseOutputStream.html new file mode 100644 index 00000000..2ce7c33b --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/BaseOutputStream.html @@ -0,0 +1,197 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.BaseOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.BaseOutputStream

+
+ + + + + + + + + +
+Packages that use BaseOutputStream
net.lingala.zip4j.io  
+  +

+ + + + + +
+Uses of BaseOutputStream in net.lingala.zip4j.io
+  +

+ + + + + + + + + + + + + + + + + +
Subclasses of BaseOutputStream in net.lingala.zip4j.io
+ classCipherOutputStream + +
+           
+ classDeflaterOutputStream + +
+           
+ classZipOutputStream + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/CipherOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/CipherOutputStream.html new file mode 100644 index 00000000..bb06f65e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/CipherOutputStream.html @@ -0,0 +1,189 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.CipherOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.CipherOutputStream

+
+ + + + + + + + + +
+Packages that use CipherOutputStream
net.lingala.zip4j.io  
+  +

+ + + + + +
+Uses of CipherOutputStream in net.lingala.zip4j.io
+  +

+ + + + + + + + + + + + + +
Subclasses of CipherOutputStream in net.lingala.zip4j.io
+ classDeflaterOutputStream + +
+           
+ classZipOutputStream + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/DeflaterOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/DeflaterOutputStream.html new file mode 100644 index 00000000..772defbb --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/DeflaterOutputStream.html @@ -0,0 +1,181 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.DeflaterOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.DeflaterOutputStream

+
+ + + + + + + + + +
+Packages that use DeflaterOutputStream
net.lingala.zip4j.io  
+  +

+ + + + + +
+Uses of DeflaterOutputStream in net.lingala.zip4j.io
+  +

+ + + + + + + + + +
Subclasses of DeflaterOutputStream in net.lingala.zip4j.io
+ classZipOutputStream + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/InflaterInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/InflaterInputStream.html new file mode 100644 index 00000000..7f98a4e1 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/InflaterInputStream.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.InflaterInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.InflaterInputStream

+
+No usage of net.lingala.zip4j.io.InflaterInputStream +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/PartInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/PartInputStream.html new file mode 100644 index 00000000..5740a0ed --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/PartInputStream.html @@ -0,0 +1,181 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.PartInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.PartInputStream

+
+ + + + + + + + + +
+Packages that use PartInputStream
net.lingala.zip4j.io  
+  +

+ + + + + +
+Uses of PartInputStream in net.lingala.zip4j.io
+  +

+ + + + + + + + + +
Subclasses of PartInputStream in net.lingala.zip4j.io
+ classInflaterInputStream + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/SplitOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/SplitOutputStream.html new file mode 100644 index 00000000..ebdd7e1b --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/SplitOutputStream.html @@ -0,0 +1,187 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.SplitOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.SplitOutputStream

+
+ + + + + + + + + +
+Packages that use SplitOutputStream
net.lingala.zip4j.core  
+  +

+ + + + + +
+Uses of SplitOutputStream in net.lingala.zip4j.core
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.core with parameters of type SplitOutputStream
+ voidHeaderWriter.updateLocalFileHeader(LocalFileHeader localFileHeader, + long offset, + int toUpdate, + ZipModel zipModel, + byte[] bytesToWrite, + int noOfDisk, + SplitOutputStream outputStream) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/ZipInputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/ZipInputStream.html new file mode 100644 index 00000000..30742193 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/ZipInputStream.html @@ -0,0 +1,219 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.ZipInputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.ZipInputStream

+
+ + + + + + + + + + + + + +
+Packages that use ZipInputStream
net.lingala.zip4j.core  
net.lingala.zip4j.unzip  
+  +

+ + + + + +
+Uses of ZipInputStream in net.lingala.zip4j.core
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.core that return ZipInputStream
+ ZipInputStreamZipFile.getInputStream(FileHeader fileHeader) + +
+          Returns an input stream for reading the contents of the Zip file corresponding + to the input FileHeader.
+  +

+ + + + + +
+Uses of ZipInputStream in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.unzip that return ZipInputStream
+ ZipInputStreamUnzipEngine.getInputStream() + +
+           
+ ZipInputStreamUnzip.getInputStream(FileHeader fileHeader) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/ZipOutputStream.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/ZipOutputStream.html new file mode 100644 index 00000000..ab8b0d7e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/class-use/ZipOutputStream.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.io.ZipOutputStream (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.io.ZipOutputStream

+
+No usage of net.lingala.zip4j.io.ZipOutputStream +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-frame.html new file mode 100644 index 00000000..98c727da --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-frame.html @@ -0,0 +1,49 @@ + + + + + + + +net.lingala.zip4j.io (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.io + + + + +
+Classes  + +
+BaseInputStream +
+BaseOutputStream +
+CipherOutputStream +
+DeflaterOutputStream +
+InflaterInputStream +
+PartInputStream +
+SplitOutputStream +
+ZipInputStream +
+ZipOutputStream
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-summary.html new file mode 100644 index 00000000..e902c728 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-summary.html @@ -0,0 +1,190 @@ + + + + + + + +net.lingala.zip4j.io (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.io +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
BaseInputStream 
BaseOutputStream 
CipherOutputStream 
DeflaterOutputStream 
InflaterInputStream 
PartInputStream 
SplitOutputStream 
ZipInputStream 
ZipOutputStream 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-tree.html new file mode 100644 index 00000000..d1c99bef --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-tree.html @@ -0,0 +1,170 @@ + + + + + + + +net.lingala.zip4j.io Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.io +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/io/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-use.html new file mode 100644 index 00000000..5056a8e7 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/io/package-use.html @@ -0,0 +1,239 @@ + + + + + + + +Uses of Package net.lingala.zip4j.io (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.io

+
+ + + + + + + + + + + + + + + + + +
+Packages that use net.lingala.zip4j.io
net.lingala.zip4j.core  
net.lingala.zip4j.io  
net.lingala.zip4j.unzip  
+  +

+ + + + + + + + + + + +
+Classes in net.lingala.zip4j.io used by net.lingala.zip4j.core
SplitOutputStream + +
+           
ZipInputStream + +
+           
+  +

+ + + + + + + + + + + + + + + + + + + + +
+Classes in net.lingala.zip4j.io used by net.lingala.zip4j.io
BaseInputStream + +
+           
BaseOutputStream + +
+           
CipherOutputStream + +
+           
DeflaterOutputStream + +
+           
PartInputStream + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.io used by net.lingala.zip4j.unzip
ZipInputStream + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/AESExtraDataRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/AESExtraDataRecord.html new file mode 100644 index 00000000..96ebf684 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/AESExtraDataRecord.html @@ -0,0 +1,462 @@ + + + + + + + +AESExtraDataRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class AESExtraDataRecord

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.AESExtraDataRecord
+
+
+
+
public class AESExtraDataRecord
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
AESExtraDataRecord() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetAesStrength() + +
+           
+ intgetCompressionMethod() + +
+           
+ intgetDataSize() + +
+           
+ longgetSignature() + +
+           
+ StringgetVendorID() + +
+           
+ intgetVersionNumber() + +
+           
+ voidsetAesStrength(int aesStrength) + +
+           
+ voidsetCompressionMethod(int compressionMethod) + +
+           
+ voidsetDataSize(int dataSize) + +
+           
+ voidsetSignature(long signature) + +
+           
+ voidsetVendorID(String vendorID) + +
+           
+ voidsetVersionNumber(int versionNumber) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+AESExtraDataRecord

+
+public AESExtraDataRecord()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSignature

+
+public long getSignature()
+
+
+
+
+
+
+ +

+setSignature

+
+public void setSignature(long signature)
+
+
+
+
+
+
+ +

+getDataSize

+
+public int getDataSize()
+
+
+
+
+
+
+ +

+setDataSize

+
+public void setDataSize(int dataSize)
+
+
+
+
+
+
+ +

+getVersionNumber

+
+public int getVersionNumber()
+
+
+
+
+
+
+ +

+setVersionNumber

+
+public void setVersionNumber(int versionNumber)
+
+
+
+
+
+
+ +

+getVendorID

+
+public String getVendorID()
+
+
+
+
+
+
+ +

+setVendorID

+
+public void setVendorID(String vendorID)
+
+
+
+
+
+
+ +

+getAesStrength

+
+public int getAesStrength()
+
+
+
+
+
+
+ +

+setAesStrength

+
+public void setAesStrength(int aesStrength)
+
+
+
+
+
+
+ +

+getCompressionMethod

+
+public int getCompressionMethod()
+
+
+
+
+
+
+ +

+setCompressionMethod

+
+public void setCompressionMethod(int compressionMethod)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/ArchiveExtraDataRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/ArchiveExtraDataRecord.html new file mode 100644 index 00000000..d7768728 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/ArchiveExtraDataRecord.html @@ -0,0 +1,348 @@ + + + + + + + +ArchiveExtraDataRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class ArchiveExtraDataRecord

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.ArchiveExtraDataRecord
+
+
+
+
public class ArchiveExtraDataRecord
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ArchiveExtraDataRecord() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ StringgetExtraFieldData() + +
+           
+ intgetExtraFieldLength() + +
+           
+ intgetSignature() + +
+           
+ voidsetExtraFieldData(String extraFieldData) + +
+           
+ voidsetExtraFieldLength(int extraFieldLength) + +
+           
+ voidsetSignature(int signature) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ArchiveExtraDataRecord

+
+public ArchiveExtraDataRecord()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSignature

+
+public int getSignature()
+
+
+
+
+
+
+ +

+setSignature

+
+public void setSignature(int signature)
+
+
+
+
+
+
+ +

+getExtraFieldLength

+
+public int getExtraFieldLength()
+
+
+
+
+
+
+ +

+setExtraFieldLength

+
+public void setExtraFieldLength(int extraFieldLength)
+
+
+
+
+
+
+ +

+getExtraFieldData

+
+public String getExtraFieldData()
+
+
+
+
+
+
+ +

+setExtraFieldData

+
+public void setExtraFieldData(String extraFieldData)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/CentralDirectory.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/CentralDirectory.html new file mode 100644 index 00000000..73f1cfe9 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/CentralDirectory.html @@ -0,0 +1,310 @@ + + + + + + + +CentralDirectory (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class CentralDirectory

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.CentralDirectory
+
+
+
+
public class CentralDirectory
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
CentralDirectory() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ DigitalSignaturegetDigitalSignature() + +
+           
+ ArrayListgetFileHeaders() + +
+           
+ voidsetDigitalSignature(DigitalSignature digitalSignature) + +
+           
+ voidsetFileHeaders(ArrayList fileHeaders) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+CentralDirectory

+
+public CentralDirectory()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getFileHeaders

+
+public ArrayList getFileHeaders()
+
+
+
+
+
+
+ +

+setFileHeaders

+
+public void setFileHeaders(ArrayList fileHeaders)
+
+
+
+
+
+
+ +

+getDigitalSignature

+
+public DigitalSignature getDigitalSignature()
+
+
+
+
+
+
+ +

+setDigitalSignature

+
+public void setDigitalSignature(DigitalSignature digitalSignature)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/DataDescriptor.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/DataDescriptor.html new file mode 100644 index 00000000..4c5e810a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/DataDescriptor.html @@ -0,0 +1,348 @@ + + + + + + + +DataDescriptor (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class DataDescriptor

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.DataDescriptor
+
+
+
+
public class DataDescriptor
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
DataDescriptor() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetCompressedSize() + +
+           
+ StringgetCrc32() + +
+           
+ intgetUncompressedSize() + +
+           
+ voidsetCompressedSize(int compressedSize) + +
+           
+ voidsetCrc32(String crc32) + +
+           
+ voidsetUncompressedSize(int uncompressedSize) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+DataDescriptor

+
+public DataDescriptor()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getCrc32

+
+public String getCrc32()
+
+
+
+
+
+
+ +

+setCrc32

+
+public void setCrc32(String crc32)
+
+
+
+
+
+
+ +

+getCompressedSize

+
+public int getCompressedSize()
+
+
+
+
+
+
+ +

+setCompressedSize

+
+public void setCompressedSize(int compressedSize)
+
+
+
+
+
+
+ +

+getUncompressedSize

+
+public int getUncompressedSize()
+
+
+
+
+
+
+ +

+setUncompressedSize

+
+public void setUncompressedSize(int uncompressedSize)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/DigitalSignature.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/DigitalSignature.html new file mode 100644 index 00000000..82209513 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/DigitalSignature.html @@ -0,0 +1,348 @@ + + + + + + + +DigitalSignature (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class DigitalSignature

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.DigitalSignature
+
+
+
+
public class DigitalSignature
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
DigitalSignature() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetHeaderSignature() + +
+           
+ StringgetSignatureData() + +
+           
+ intgetSizeOfData() + +
+           
+ voidsetHeaderSignature(int headerSignature) + +
+           
+ voidsetSignatureData(String signatureData) + +
+           
+ voidsetSizeOfData(int sizeOfData) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+DigitalSignature

+
+public DigitalSignature()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getHeaderSignature

+
+public int getHeaderSignature()
+
+
+
+
+
+
+ +

+setHeaderSignature

+
+public void setHeaderSignature(int headerSignature)
+
+
+
+
+
+
+ +

+getSizeOfData

+
+public int getSizeOfData()
+
+
+
+
+
+
+ +

+setSizeOfData

+
+public void setSizeOfData(int sizeOfData)
+
+
+
+
+
+
+ +

+getSignatureData

+
+public String getSignatureData()
+
+
+
+
+
+
+ +

+setSignatureData

+
+public void setSignatureData(String signatureData)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/EndCentralDirRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/EndCentralDirRecord.html new file mode 100644 index 00000000..8587298a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/EndCentralDirRecord.html @@ -0,0 +1,614 @@ + + + + + + + +EndCentralDirRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class EndCentralDirRecord

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.EndCentralDirRecord
+
+
+
+
public class EndCentralDirRecord
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
EndCentralDirRecord() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ StringgetComment() + +
+           
+ byte[]getCommentBytes() + +
+           
+ intgetCommentLength() + +
+           
+ intgetNoOfThisDisk() + +
+           
+ intgetNoOfThisDiskStartOfCentralDir() + +
+           
+ longgetOffsetOfStartOfCentralDir() + +
+           
+ longgetSignature() + +
+           
+ intgetSizeOfCentralDir() + +
+           
+ intgetTotNoOfEntriesInCentralDir() + +
+           
+ intgetTotNoOfEntriesInCentralDirOnThisDisk() + +
+           
+ voidsetComment(String comment) + +
+           
+ voidsetCommentBytes(byte[] commentBytes) + +
+           
+ voidsetCommentLength(int commentLength) + +
+           
+ voidsetNoOfThisDisk(int noOfThisDisk) + +
+           
+ voidsetNoOfThisDiskStartOfCentralDir(int noOfThisDiskStartOfCentralDir) + +
+           
+ voidsetOffsetOfStartOfCentralDir(long offSetOfStartOfCentralDir) + +
+           
+ voidsetSignature(long signature) + +
+           
+ voidsetSizeOfCentralDir(int sizeOfCentralDir) + +
+           
+ voidsetTotNoOfEntriesInCentralDir(int totNoOfEntrisInCentralDir) + +
+           
+ voidsetTotNoOfEntriesInCentralDirOnThisDisk(int totNoOfEntriesInCentralDirOnThisDisk) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+EndCentralDirRecord

+
+public EndCentralDirRecord()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSignature

+
+public long getSignature()
+
+
+
+
+
+
+ +

+setSignature

+
+public void setSignature(long signature)
+
+
+
+
+
+
+ +

+getNoOfThisDisk

+
+public int getNoOfThisDisk()
+
+
+
+
+
+
+ +

+setNoOfThisDisk

+
+public void setNoOfThisDisk(int noOfThisDisk)
+
+
+
+
+
+
+ +

+getNoOfThisDiskStartOfCentralDir

+
+public int getNoOfThisDiskStartOfCentralDir()
+
+
+
+
+
+
+ +

+setNoOfThisDiskStartOfCentralDir

+
+public void setNoOfThisDiskStartOfCentralDir(int noOfThisDiskStartOfCentralDir)
+
+
+
+
+
+
+ +

+getTotNoOfEntriesInCentralDirOnThisDisk

+
+public int getTotNoOfEntriesInCentralDirOnThisDisk()
+
+
+
+
+
+
+ +

+setTotNoOfEntriesInCentralDirOnThisDisk

+
+public void setTotNoOfEntriesInCentralDirOnThisDisk(int totNoOfEntriesInCentralDirOnThisDisk)
+
+
+
+
+
+
+ +

+getTotNoOfEntriesInCentralDir

+
+public int getTotNoOfEntriesInCentralDir()
+
+
+
+
+
+
+ +

+setTotNoOfEntriesInCentralDir

+
+public void setTotNoOfEntriesInCentralDir(int totNoOfEntrisInCentralDir)
+
+
+
+
+
+
+ +

+getSizeOfCentralDir

+
+public int getSizeOfCentralDir()
+
+
+
+
+
+
+ +

+setSizeOfCentralDir

+
+public void setSizeOfCentralDir(int sizeOfCentralDir)
+
+
+
+
+
+
+ +

+getOffsetOfStartOfCentralDir

+
+public long getOffsetOfStartOfCentralDir()
+
+
+
+
+
+
+ +

+setOffsetOfStartOfCentralDir

+
+public void setOffsetOfStartOfCentralDir(long offSetOfStartOfCentralDir)
+
+
+
+
+
+
+ +

+getCommentLength

+
+public int getCommentLength()
+
+
+
+
+
+
+ +

+setCommentLength

+
+public void setCommentLength(int commentLength)
+
+
+
+
+
+
+ +

+getComment

+
+public String getComment()
+
+
+
+
+
+
+ +

+setComment

+
+public void setComment(String comment)
+
+
+
+
+
+
+ +

+getCommentBytes

+
+public byte[] getCommentBytes()
+
+
+
+
+
+
+ +

+setCommentBytes

+
+public void setCommentBytes(byte[] commentBytes)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/ExtraDataRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/ExtraDataRecord.html new file mode 100644 index 00000000..f94573d7 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/ExtraDataRecord.html @@ -0,0 +1,348 @@ + + + + + + + +ExtraDataRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class ExtraDataRecord

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.ExtraDataRecord
+
+
+
+
public class ExtraDataRecord
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ExtraDataRecord() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ byte[]getData() + +
+           
+ longgetHeader() + +
+           
+ intgetSizeOfData() + +
+           
+ voidsetData(byte[] data) + +
+           
+ voidsetHeader(long header) + +
+           
+ voidsetSizeOfData(int sizeOfData) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ExtraDataRecord

+
+public ExtraDataRecord()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getHeader

+
+public long getHeader()
+
+
+
+
+
+
+ +

+setHeader

+
+public void setHeader(long header)
+
+
+
+
+
+
+ +

+getSizeOfData

+
+public int getSizeOfData()
+
+
+
+
+
+
+ +

+setSizeOfData

+
+public void setSizeOfData(int sizeOfData)
+
+
+
+
+
+
+ +

+getData

+
+public byte[] getData()
+
+
+
+
+
+
+ +

+setData

+
+public void setData(byte[] data)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/FileHeader.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/FileHeader.html new file mode 100644 index 00000000..2965c054 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/FileHeader.html @@ -0,0 +1,1401 @@ + + + + + + + +FileHeader (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class FileHeader

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.FileHeader
+
+
+
+
public class FileHeader
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
FileHeader() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidextractFile(ZipModel zipModel, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory
+ voidextractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters
+ voidextractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters.
+ AESExtraDataRecordgetAesExtraDataRecord() + +
+           
+ longgetCompressedSize() + +
+           
+ intgetCompressionMethod() + +
+           
+ longgetCrc32() + +
+           
+ byte[]getCrcBuff() + +
+           
+ intgetDiskNumberStart() + +
+           
+ intgetEncryptionMethod() + +
+           
+ byte[]getExternalFileAttr() + +
+           
+ ArrayListgetExtraDataRecords() + +
+           
+ intgetExtraFieldLength() + +
+           
+ StringgetFileComment() + +
+           
+ intgetFileCommentLength() + +
+           
+ StringgetFileName() + +
+           
+ intgetFileNameLength() + +
+           
+ byte[]getGeneralPurposeFlag() + +
+           
+ byte[]getInternalFileAttr() + +
+           
+ intgetLastModFileTime() + +
+           
+ longgetOffsetLocalHeader() + +
+           
+ char[]getPassword() + +
+           
+ intgetSignature() + +
+           
+ longgetUncompressedSize() + +
+           
+ intgetVersionMadeBy() + +
+           
+ intgetVersionNeededToExtract() + +
+           
+ Zip64ExtendedInfogetZip64ExtendedInfo() + +
+           
+ booleanisDataDescriptorExists() + +
+           
+ booleanisDirectory() + +
+           
+ booleanisEncrypted() + +
+           
+ booleanisFileNameUTF8Encoded() + +
+           
+ voidsetAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord) + +
+           
+ voidsetCompressedSize(long compressedSize) + +
+           
+ voidsetCompressionMethod(int compressionMethod) + +
+           
+ voidsetCrc32(long crc32) + +
+           
+ voidsetCrcBuff(byte[] crcBuff) + +
+           
+ voidsetDataDescriptorExists(boolean dataDescriptorExists) + +
+           
+ voidsetDirectory(boolean isDirectory) + +
+           
+ voidsetDiskNumberStart(int diskNumberStart) + +
+           
+ voidsetEncrypted(boolean isEncrypted) + +
+           
+ voidsetEncryptionMethod(int encryptionMethod) + +
+           
+ voidsetExternalFileAttr(byte[] externalFileAttr) + +
+           
+ voidsetExtraDataRecords(ArrayList extraDataRecords) + +
+           
+ voidsetExtraFieldLength(int extraFieldLength) + +
+           
+ voidsetFileComment(String fileComment) + +
+           
+ voidsetFileCommentLength(int fileCommentLength) + +
+           
+ voidsetFileName(String fileName) + +
+           
+ voidsetFileNameLength(int fileNameLength) + +
+           
+ voidsetFileNameUTF8Encoded(boolean fileNameUTF8Encoded) + +
+           
+ voidsetGeneralPurposeFlag(byte[] generalPurposeFlag) + +
+           
+ voidsetInternalFileAttr(byte[] internalFileAttr) + +
+           
+ voidsetLastModFileTime(int lastModFileTime) + +
+           
+ voidsetOffsetLocalHeader(long offsetLocalHeader) + +
+           
+ voidsetPassword(char[] password) + +
+           
+ voidsetSignature(int signature) + +
+           
+ voidsetUncompressedSize(long uncompressedSize) + +
+           
+ voidsetVersionMadeBy(int versionMadeBy) + +
+           
+ voidsetVersionNeededToExtract(int versionNeededToExtract) + +
+           
+ voidsetZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+FileHeader

+
+public FileHeader()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSignature

+
+public int getSignature()
+
+
+
+
+
+
+ +

+setSignature

+
+public void setSignature(int signature)
+
+
+
+
+
+
+ +

+getVersionMadeBy

+
+public int getVersionMadeBy()
+
+
+
+
+
+
+ +

+setVersionMadeBy

+
+public void setVersionMadeBy(int versionMadeBy)
+
+
+
+
+
+
+ +

+getVersionNeededToExtract

+
+public int getVersionNeededToExtract()
+
+
+
+
+
+
+ +

+setVersionNeededToExtract

+
+public void setVersionNeededToExtract(int versionNeededToExtract)
+
+
+
+
+
+
+ +

+getGeneralPurposeFlag

+
+public byte[] getGeneralPurposeFlag()
+
+
+
+
+
+
+ +

+setGeneralPurposeFlag

+
+public void setGeneralPurposeFlag(byte[] generalPurposeFlag)
+
+
+
+
+
+
+ +

+getCompressionMethod

+
+public int getCompressionMethod()
+
+
+
+
+
+
+ +

+setCompressionMethod

+
+public void setCompressionMethod(int compressionMethod)
+
+
+
+
+
+
+ +

+getLastModFileTime

+
+public int getLastModFileTime()
+
+
+
+
+
+
+ +

+setLastModFileTime

+
+public void setLastModFileTime(int lastModFileTime)
+
+
+
+
+
+
+ +

+getCrc32

+
+public long getCrc32()
+
+
+
+
+
+
+ +

+setCrc32

+
+public void setCrc32(long crc32)
+
+
+
+
+
+
+ +

+getCompressedSize

+
+public long getCompressedSize()
+
+
+
+
+
+
+ +

+setCompressedSize

+
+public void setCompressedSize(long compressedSize)
+
+
+
+
+
+
+ +

+getUncompressedSize

+
+public long getUncompressedSize()
+
+
+
+
+
+
+ +

+setUncompressedSize

+
+public void setUncompressedSize(long uncompressedSize)
+
+
+
+
+
+
+ +

+getFileNameLength

+
+public int getFileNameLength()
+
+
+
+
+
+
+ +

+setFileNameLength

+
+public void setFileNameLength(int fileNameLength)
+
+
+
+
+
+
+ +

+getExtraFieldLength

+
+public int getExtraFieldLength()
+
+
+
+
+
+
+ +

+setExtraFieldLength

+
+public void setExtraFieldLength(int extraFieldLength)
+
+
+
+
+
+
+ +

+getFileCommentLength

+
+public int getFileCommentLength()
+
+
+
+
+
+
+ +

+setFileCommentLength

+
+public void setFileCommentLength(int fileCommentLength)
+
+
+
+
+
+
+ +

+getDiskNumberStart

+
+public int getDiskNumberStart()
+
+
+
+
+
+
+ +

+setDiskNumberStart

+
+public void setDiskNumberStart(int diskNumberStart)
+
+
+
+
+
+
+ +

+getInternalFileAttr

+
+public byte[] getInternalFileAttr()
+
+
+
+
+
+
+ +

+setInternalFileAttr

+
+public void setInternalFileAttr(byte[] internalFileAttr)
+
+
+
+
+
+
+ +

+getExternalFileAttr

+
+public byte[] getExternalFileAttr()
+
+
+
+
+
+
+ +

+setExternalFileAttr

+
+public void setExternalFileAttr(byte[] externalFileAttr)
+
+
+
+
+
+
+ +

+getOffsetLocalHeader

+
+public long getOffsetLocalHeader()
+
+
+
+
+
+
+ +

+setOffsetLocalHeader

+
+public void setOffsetLocalHeader(long offsetLocalHeader)
+
+
+
+
+
+
+ +

+getFileName

+
+public String getFileName()
+
+
+
+
+
+
+ +

+setFileName

+
+public void setFileName(String fileName)
+
+
+
+
+
+
+ +

+getFileComment

+
+public String getFileComment()
+
+
+
+
+
+
+ +

+setFileComment

+
+public void setFileComment(String fileComment)
+
+
+
+
+
+
+ +

+isDirectory

+
+public boolean isDirectory()
+
+
+
+
+
+
+ +

+setDirectory

+
+public void setDirectory(boolean isDirectory)
+
+
+
+
+
+
+ +

+extractFile

+
+public void extractFile(ZipModel zipModel,
+                        String outPath,
+                        ProgressMonitor progressMonitor,
+                        boolean runInThread)
+                 throws ZipException
+
+
Extracts file to the specified directory +

+

+
Parameters:
zipModel -
outPath - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(ZipModel zipModel,
+                        String outPath,
+                        UnzipParameters unzipParameters,
+                        ProgressMonitor progressMonitor,
+                        boolean runInThread)
+                 throws ZipException
+
+
Extracts file to the specified directory using any + user defined parameters in UnzipParameters +

+

+
Parameters:
zipModel -
outPath -
unzipParameters - +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(ZipModel zipModel,
+                        String outPath,
+                        UnzipParameters unzipParameters,
+                        String newFileName,
+                        ProgressMonitor progressMonitor,
+                        boolean runInThread)
+                 throws ZipException
+
+
Extracts file to the specified directory using any + user defined parameters in UnzipParameters. Output file name + will be overwritten with the value in newFileName. If this + parameter is null, then file name will be the same as in + FileHeader.getFileName +

+

+
Parameters:
zipModel -
outPath -
unzipParameters - +
Throws: +
ZipException
+
+
+
+ +

+isEncrypted

+
+public boolean isEncrypted()
+
+
+
+
+
+
+ +

+setEncrypted

+
+public void setEncrypted(boolean isEncrypted)
+
+
+
+
+
+
+ +

+getEncryptionMethod

+
+public int getEncryptionMethod()
+
+
+
+
+
+
+ +

+setEncryptionMethod

+
+public void setEncryptionMethod(int encryptionMethod)
+
+
+
+
+
+
+ +

+getPassword

+
+public char[] getPassword()
+
+
+
+
+
+
+ +

+setPassword

+
+public void setPassword(char[] password)
+
+
+
+
+
+
+ +

+getCrcBuff

+
+public byte[] getCrcBuff()
+
+
+
+
+
+
+ +

+setCrcBuff

+
+public void setCrcBuff(byte[] crcBuff)
+
+
+
+
+
+
+ +

+getExtraDataRecords

+
+public ArrayList getExtraDataRecords()
+
+
+
+
+
+
+ +

+setExtraDataRecords

+
+public void setExtraDataRecords(ArrayList extraDataRecords)
+
+
+
+
+
+
+ +

+isDataDescriptorExists

+
+public boolean isDataDescriptorExists()
+
+
+
+
+
+
+ +

+setDataDescriptorExists

+
+public void setDataDescriptorExists(boolean dataDescriptorExists)
+
+
+
+
+
+
+ +

+getZip64ExtendedInfo

+
+public Zip64ExtendedInfo getZip64ExtendedInfo()
+
+
+
+
+
+
+ +

+setZip64ExtendedInfo

+
+public void setZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo)
+
+
+
+
+
+
+ +

+getAesExtraDataRecord

+
+public AESExtraDataRecord getAesExtraDataRecord()
+
+
+
+
+
+
+ +

+setAesExtraDataRecord

+
+public void setAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord)
+
+
+
+
+
+
+ +

+isFileNameUTF8Encoded

+
+public boolean isFileNameUTF8Encoded()
+
+
+
+
+
+
+ +

+setFileNameUTF8Encoded

+
+public void setFileNameUTF8Encoded(boolean fileNameUTF8Encoded)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/LocalFileHeader.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/LocalFileHeader.html new file mode 100644 index 00000000..3f841f92 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/LocalFileHeader.html @@ -0,0 +1,1108 @@ + + + + + + + +LocalFileHeader (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class LocalFileHeader

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.LocalFileHeader
+
+
+
+
public class LocalFileHeader
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
LocalFileHeader() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ AESExtraDataRecordgetAesExtraDataRecord() + +
+           
+ longgetCompressedSize() + +
+           
+ intgetCompressionMethod() + +
+           
+ longgetCrc32() + +
+           
+ byte[]getCrcBuff() + +
+           
+ intgetEncryptionMethod() + +
+           
+ ArrayListgetExtraDataRecords() + +
+           
+ byte[]getExtraField() + +
+           
+ intgetExtraFieldLength() + +
+           
+ StringgetFileName() + +
+           
+ intgetFileNameLength() + +
+           
+ byte[]getGeneralPurposeFlag() + +
+           
+ intgetLastModFileTime() + +
+           
+ longgetOffsetStartOfData() + +
+           
+ char[]getPassword() + +
+           
+ intgetSignature() + +
+           
+ longgetUncompressedSize() + +
+           
+ intgetVersionNeededToExtract() + +
+           
+ Zip64ExtendedInfogetZip64ExtendedInfo() + +
+           
+ booleanisDataDescriptorExists() + +
+           
+ booleanisEncrypted() + +
+           
+ booleanisFileNameUTF8Encoded() + +
+           
+ booleanisWriteComprSizeInZip64ExtraRecord() + +
+           
+ voidsetAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord) + +
+           
+ voidsetCompressedSize(long compressedSize) + +
+           
+ voidsetCompressionMethod(int compressionMethod) + +
+           
+ voidsetCrc32(long crc32) + +
+           
+ voidsetCrcBuff(byte[] crcBuff) + +
+           
+ voidsetDataDescriptorExists(boolean dataDescriptorExists) + +
+           
+ voidsetEncrypted(boolean isEncrypted) + +
+           
+ voidsetEncryptionMethod(int encryptionMethod) + +
+           
+ voidsetExtraDataRecords(ArrayList extraDataRecords) + +
+           
+ voidsetExtraField(byte[] extraField) + +
+           
+ voidsetExtraFieldLength(int extraFieldLength) + +
+           
+ voidsetFileName(String fileName) + +
+           
+ voidsetFileNameLength(int fileNameLength) + +
+           
+ voidsetFileNameUTF8Encoded(boolean fileNameUTF8Encoded) + +
+           
+ voidsetGeneralPurposeFlag(byte[] generalPurposeFlag) + +
+           
+ voidsetLastModFileTime(int lastModFileTime) + +
+           
+ voidsetOffsetStartOfData(long offsetStartOfData) + +
+           
+ voidsetPassword(char[] password) + +
+           
+ voidsetSignature(int signature) + +
+           
+ voidsetUncompressedSize(long uncompressedSize) + +
+           
+ voidsetVersionNeededToExtract(int versionNeededToExtract) + +
+           
+ voidsetWriteComprSizeInZip64ExtraRecord(boolean writeComprSizeInZip64ExtraRecord) + +
+           
+ voidsetZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+LocalFileHeader

+
+public LocalFileHeader()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSignature

+
+public int getSignature()
+
+
+
+
+
+
+ +

+setSignature

+
+public void setSignature(int signature)
+
+
+
+
+
+
+ +

+getVersionNeededToExtract

+
+public int getVersionNeededToExtract()
+
+
+
+
+
+
+ +

+setVersionNeededToExtract

+
+public void setVersionNeededToExtract(int versionNeededToExtract)
+
+
+
+
+
+
+ +

+getGeneralPurposeFlag

+
+public byte[] getGeneralPurposeFlag()
+
+
+
+
+
+
+ +

+setGeneralPurposeFlag

+
+public void setGeneralPurposeFlag(byte[] generalPurposeFlag)
+
+
+
+
+
+
+ +

+getCompressionMethod

+
+public int getCompressionMethod()
+
+
+
+
+
+
+ +

+setCompressionMethod

+
+public void setCompressionMethod(int compressionMethod)
+
+
+
+
+
+
+ +

+getLastModFileTime

+
+public int getLastModFileTime()
+
+
+
+
+
+
+ +

+setLastModFileTime

+
+public void setLastModFileTime(int lastModFileTime)
+
+
+
+
+
+
+ +

+getCrc32

+
+public long getCrc32()
+
+
+
+
+
+
+ +

+setCrc32

+
+public void setCrc32(long crc32)
+
+
+
+
+
+
+ +

+getCompressedSize

+
+public long getCompressedSize()
+
+
+
+
+
+
+ +

+setCompressedSize

+
+public void setCompressedSize(long compressedSize)
+
+
+
+
+
+
+ +

+getUncompressedSize

+
+public long getUncompressedSize()
+
+
+
+
+
+
+ +

+setUncompressedSize

+
+public void setUncompressedSize(long uncompressedSize)
+
+
+
+
+
+
+ +

+getFileNameLength

+
+public int getFileNameLength()
+
+
+
+
+
+
+ +

+setFileNameLength

+
+public void setFileNameLength(int fileNameLength)
+
+
+
+
+
+
+ +

+getExtraFieldLength

+
+public int getExtraFieldLength()
+
+
+
+
+
+
+ +

+setExtraFieldLength

+
+public void setExtraFieldLength(int extraFieldLength)
+
+
+
+
+
+
+ +

+getFileName

+
+public String getFileName()
+
+
+
+
+
+
+ +

+setFileName

+
+public void setFileName(String fileName)
+
+
+
+
+
+
+ +

+getExtraField

+
+public byte[] getExtraField()
+
+
+
+
+
+
+ +

+setExtraField

+
+public void setExtraField(byte[] extraField)
+
+
+
+
+
+
+ +

+getOffsetStartOfData

+
+public long getOffsetStartOfData()
+
+
+
+
+
+
+ +

+setOffsetStartOfData

+
+public void setOffsetStartOfData(long offsetStartOfData)
+
+
+
+
+
+
+ +

+isEncrypted

+
+public boolean isEncrypted()
+
+
+
+
+
+
+ +

+setEncrypted

+
+public void setEncrypted(boolean isEncrypted)
+
+
+
+
+
+
+ +

+getEncryptionMethod

+
+public int getEncryptionMethod()
+
+
+
+
+
+
+ +

+setEncryptionMethod

+
+public void setEncryptionMethod(int encryptionMethod)
+
+
+
+
+
+
+ +

+getCrcBuff

+
+public byte[] getCrcBuff()
+
+
+
+
+
+
+ +

+setCrcBuff

+
+public void setCrcBuff(byte[] crcBuff)
+
+
+
+
+
+
+ +

+getPassword

+
+public char[] getPassword()
+
+
+
+
+
+
+ +

+setPassword

+
+public void setPassword(char[] password)
+
+
+
+
+
+
+ +

+getExtraDataRecords

+
+public ArrayList getExtraDataRecords()
+
+
+
+
+
+
+ +

+setExtraDataRecords

+
+public void setExtraDataRecords(ArrayList extraDataRecords)
+
+
+
+
+
+
+ +

+isDataDescriptorExists

+
+public boolean isDataDescriptorExists()
+
+
+
+
+
+
+ +

+setDataDescriptorExists

+
+public void setDataDescriptorExists(boolean dataDescriptorExists)
+
+
+
+
+
+
+ +

+getZip64ExtendedInfo

+
+public Zip64ExtendedInfo getZip64ExtendedInfo()
+
+
+
+
+
+
+ +

+setZip64ExtendedInfo

+
+public void setZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo)
+
+
+
+
+
+
+ +

+getAesExtraDataRecord

+
+public AESExtraDataRecord getAesExtraDataRecord()
+
+
+
+
+
+
+ +

+setAesExtraDataRecord

+
+public void setAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord)
+
+
+
+
+
+
+ +

+isWriteComprSizeInZip64ExtraRecord

+
+public boolean isWriteComprSizeInZip64ExtraRecord()
+
+
+
+
+
+
+ +

+setWriteComprSizeInZip64ExtraRecord

+
+public void setWriteComprSizeInZip64ExtraRecord(boolean writeComprSizeInZip64ExtraRecord)
+
+
+
+
+
+
+ +

+isFileNameUTF8Encoded

+
+public boolean isFileNameUTF8Encoded()
+
+
+
+
+
+
+ +

+setFileNameUTF8Encoded

+
+public void setFileNameUTF8Encoded(boolean fileNameUTF8Encoded)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/UnzipEngineParameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/UnzipEngineParameters.html new file mode 100644 index 00000000..105cd61d --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/UnzipEngineParameters.html @@ -0,0 +1,462 @@ + + + + + + + +UnzipEngineParameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class UnzipEngineParameters

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.UnzipEngineParameters
+
+
+
+
public class UnzipEngineParameters
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
UnzipEngineParameters() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ FileHeadergetFileHeader() + +
+           
+ IDecryptergetIDecryptor() + +
+           
+ LocalFileHeadergetLocalFileHeader() + +
+           
+ FileOutputStreamgetOutputStream() + +
+           
+ UnzipEnginegetUnzipEngine() + +
+           
+ ZipModelgetZipModel() + +
+           
+ voidsetFileHeader(FileHeader fileHeader) + +
+           
+ voidsetIDecryptor(IDecrypter decrypter) + +
+           
+ voidsetLocalFileHeader(LocalFileHeader localFileHeader) + +
+           
+ voidsetOutputStream(FileOutputStream outputStream) + +
+           
+ voidsetUnzipEngine(UnzipEngine unzipEngine) + +
+           
+ voidsetZipModel(ZipModel zipModel) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+UnzipEngineParameters

+
+public UnzipEngineParameters()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getZipModel

+
+public ZipModel getZipModel()
+
+
+
+
+
+
+ +

+setZipModel

+
+public void setZipModel(ZipModel zipModel)
+
+
+
+
+
+
+ +

+getFileHeader

+
+public FileHeader getFileHeader()
+
+
+
+
+
+
+ +

+setFileHeader

+
+public void setFileHeader(FileHeader fileHeader)
+
+
+
+
+
+
+ +

+getLocalFileHeader

+
+public LocalFileHeader getLocalFileHeader()
+
+
+
+
+
+
+ +

+setLocalFileHeader

+
+public void setLocalFileHeader(LocalFileHeader localFileHeader)
+
+
+
+
+
+
+ +

+getIDecryptor

+
+public IDecrypter getIDecryptor()
+
+
+
+
+
+
+ +

+setIDecryptor

+
+public void setIDecryptor(IDecrypter decrypter)
+
+
+
+
+
+
+ +

+getOutputStream

+
+public FileOutputStream getOutputStream()
+
+
+
+
+
+
+ +

+setOutputStream

+
+public void setOutputStream(FileOutputStream outputStream)
+
+
+
+
+
+
+ +

+getUnzipEngine

+
+public UnzipEngine getUnzipEngine()
+
+
+
+
+
+
+ +

+setUnzipEngine

+
+public void setUnzipEngine(UnzipEngine unzipEngine)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/UnzipParameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/UnzipParameters.html new file mode 100644 index 00000000..cc5ecd74 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/UnzipParameters.html @@ -0,0 +1,462 @@ + + + + + + + +UnzipParameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class UnzipParameters

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.UnzipParameters
+
+
+
+
public class UnzipParameters
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
UnzipParameters() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleanisIgnoreAllFileAttributes() + +
+           
+ booleanisIgnoreArchiveFileAttribute() + +
+           
+ booleanisIgnoreDateTimeAttributes() + +
+           
+ booleanisIgnoreHiddenFileAttribute() + +
+           
+ booleanisIgnoreReadOnlyFileAttribute() + +
+           
+ booleanisIgnoreSystemFileAttribute() + +
+           
+ voidsetIgnoreAllFileAttributes(boolean ignoreAllFileAttributes) + +
+           
+ voidsetIgnoreArchiveFileAttribute(boolean ignoreArchiveFileAttribute) + +
+           
+ voidsetIgnoreDateTimeAttributes(boolean ignoreDateTimeAttributes) + +
+           
+ voidsetIgnoreHiddenFileAttribute(boolean ignoreHiddenFileAttribute) + +
+           
+ voidsetIgnoreReadOnlyFileAttribute(boolean ignoreReadOnlyFileAttribute) + +
+           
+ voidsetIgnoreSystemFileAttribute(boolean ignoreSystemFileAttribute) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+UnzipParameters

+
+public UnzipParameters()
+
+
+ + + + + + + + +
+Method Detail
+ +

+isIgnoreReadOnlyFileAttribute

+
+public boolean isIgnoreReadOnlyFileAttribute()
+
+
+
+
+
+
+ +

+setIgnoreReadOnlyFileAttribute

+
+public void setIgnoreReadOnlyFileAttribute(boolean ignoreReadOnlyFileAttribute)
+
+
+
+
+
+
+ +

+isIgnoreHiddenFileAttribute

+
+public boolean isIgnoreHiddenFileAttribute()
+
+
+
+
+
+
+ +

+setIgnoreHiddenFileAttribute

+
+public void setIgnoreHiddenFileAttribute(boolean ignoreHiddenFileAttribute)
+
+
+
+
+
+
+ +

+isIgnoreArchiveFileAttribute

+
+public boolean isIgnoreArchiveFileAttribute()
+
+
+
+
+
+
+ +

+setIgnoreArchiveFileAttribute

+
+public void setIgnoreArchiveFileAttribute(boolean ignoreArchiveFileAttribute)
+
+
+
+
+
+
+ +

+isIgnoreSystemFileAttribute

+
+public boolean isIgnoreSystemFileAttribute()
+
+
+
+
+
+
+ +

+setIgnoreSystemFileAttribute

+
+public void setIgnoreSystemFileAttribute(boolean ignoreSystemFileAttribute)
+
+
+
+
+
+
+ +

+isIgnoreAllFileAttributes

+
+public boolean isIgnoreAllFileAttributes()
+
+
+
+
+
+
+ +

+setIgnoreAllFileAttributes

+
+public void setIgnoreAllFileAttributes(boolean ignoreAllFileAttributes)
+
+
+
+
+
+
+ +

+isIgnoreDateTimeAttributes

+
+public boolean isIgnoreDateTimeAttributes()
+
+
+
+
+
+
+ +

+setIgnoreDateTimeAttributes

+
+public void setIgnoreDateTimeAttributes(boolean ignoreDateTimeAttributes)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64EndCentralDirLocator.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64EndCentralDirLocator.html new file mode 100644 index 00000000..c86b66af --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64EndCentralDirLocator.html @@ -0,0 +1,386 @@ + + + + + + + +Zip64EndCentralDirLocator (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class Zip64EndCentralDirLocator

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.Zip64EndCentralDirLocator
+
+
+
+
public class Zip64EndCentralDirLocator
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
Zip64EndCentralDirLocator() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetNoOfDiskStartOfZip64EndOfCentralDirRec() + +
+           
+ longgetOffsetZip64EndOfCentralDirRec() + +
+           
+ longgetSignature() + +
+           
+ intgetTotNumberOfDiscs() + +
+           
+ voidsetNoOfDiskStartOfZip64EndOfCentralDirRec(int noOfDiskStartOfZip64EndOfCentralDirRec) + +
+           
+ voidsetOffsetZip64EndOfCentralDirRec(long offsetZip64EndOfCentralDirRec) + +
+           
+ voidsetSignature(long signature) + +
+           
+ voidsetTotNumberOfDiscs(int totNumberOfDiscs) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Zip64EndCentralDirLocator

+
+public Zip64EndCentralDirLocator()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSignature

+
+public long getSignature()
+
+
+
+
+
+
+ +

+setSignature

+
+public void setSignature(long signature)
+
+
+
+
+
+
+ +

+getNoOfDiskStartOfZip64EndOfCentralDirRec

+
+public int getNoOfDiskStartOfZip64EndOfCentralDirRec()
+
+
+
+
+
+
+ +

+setNoOfDiskStartOfZip64EndOfCentralDirRec

+
+public void setNoOfDiskStartOfZip64EndOfCentralDirRec(int noOfDiskStartOfZip64EndOfCentralDirRec)
+
+
+
+
+
+
+ +

+getOffsetZip64EndOfCentralDirRec

+
+public long getOffsetZip64EndOfCentralDirRec()
+
+
+
+
+
+
+ +

+setOffsetZip64EndOfCentralDirRec

+
+public void setOffsetZip64EndOfCentralDirRec(long offsetZip64EndOfCentralDirRec)
+
+
+
+
+
+
+ +

+getTotNumberOfDiscs

+
+public int getTotNumberOfDiscs()
+
+
+
+
+
+
+ +

+setTotNumberOfDiscs

+
+public void setTotNumberOfDiscs(int totNumberOfDiscs)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64EndCentralDirRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64EndCentralDirRecord.html new file mode 100644 index 00000000..b82b4482 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64EndCentralDirRecord.html @@ -0,0 +1,652 @@ + + + + + + + +Zip64EndCentralDirRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class Zip64EndCentralDirRecord

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.Zip64EndCentralDirRecord
+
+
+
+
public class Zip64EndCentralDirRecord
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
Zip64EndCentralDirRecord() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ byte[]getExtensibleDataSector() + +
+           
+ intgetNoOfThisDisk() + +
+           
+ intgetNoOfThisDiskStartOfCentralDir() + +
+           
+ longgetOffsetStartCenDirWRTStartDiskNo() + +
+           
+ longgetSignature() + +
+           
+ longgetSizeOfCentralDir() + +
+           
+ longgetSizeOfZip64EndCentralDirRec() + +
+           
+ longgetTotNoOfEntriesInCentralDir() + +
+           
+ longgetTotNoOfEntriesInCentralDirOnThisDisk() + +
+           
+ intgetVersionMadeBy() + +
+           
+ intgetVersionNeededToExtract() + +
+           
+ voidsetExtensibleDataSector(byte[] extensibleDataSector) + +
+           
+ voidsetNoOfThisDisk(int noOfThisDisk) + +
+           
+ voidsetNoOfThisDiskStartOfCentralDir(int noOfThisDiskStartOfCentralDir) + +
+           
+ voidsetOffsetStartCenDirWRTStartDiskNo(long offsetStartCenDirWRTStartDiskNo) + +
+           
+ voidsetSignature(long signature) + +
+           
+ voidsetSizeOfCentralDir(long sizeOfCentralDir) + +
+           
+ voidsetSizeOfZip64EndCentralDirRec(long sizeOfZip64EndCentralDirRec) + +
+           
+ voidsetTotNoOfEntriesInCentralDir(long totNoOfEntriesInCentralDir) + +
+           
+ voidsetTotNoOfEntriesInCentralDirOnThisDisk(long totNoOfEntriesInCentralDirOnThisDisk) + +
+           
+ voidsetVersionMadeBy(int versionMadeBy) + +
+           
+ voidsetVersionNeededToExtract(int versionNeededToExtract) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Zip64EndCentralDirRecord

+
+public Zip64EndCentralDirRecord()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getSignature

+
+public long getSignature()
+
+
+
+
+
+
+ +

+setSignature

+
+public void setSignature(long signature)
+
+
+
+
+
+
+ +

+getSizeOfZip64EndCentralDirRec

+
+public long getSizeOfZip64EndCentralDirRec()
+
+
+
+
+
+
+ +

+setSizeOfZip64EndCentralDirRec

+
+public void setSizeOfZip64EndCentralDirRec(long sizeOfZip64EndCentralDirRec)
+
+
+
+
+
+
+ +

+getVersionMadeBy

+
+public int getVersionMadeBy()
+
+
+
+
+
+
+ +

+setVersionMadeBy

+
+public void setVersionMadeBy(int versionMadeBy)
+
+
+
+
+
+
+ +

+getVersionNeededToExtract

+
+public int getVersionNeededToExtract()
+
+
+
+
+
+
+ +

+setVersionNeededToExtract

+
+public void setVersionNeededToExtract(int versionNeededToExtract)
+
+
+
+
+
+
+ +

+getNoOfThisDisk

+
+public int getNoOfThisDisk()
+
+
+
+
+
+
+ +

+setNoOfThisDisk

+
+public void setNoOfThisDisk(int noOfThisDisk)
+
+
+
+
+
+
+ +

+getNoOfThisDiskStartOfCentralDir

+
+public int getNoOfThisDiskStartOfCentralDir()
+
+
+
+
+
+
+ +

+setNoOfThisDiskStartOfCentralDir

+
+public void setNoOfThisDiskStartOfCentralDir(int noOfThisDiskStartOfCentralDir)
+
+
+
+
+
+
+ +

+getTotNoOfEntriesInCentralDirOnThisDisk

+
+public long getTotNoOfEntriesInCentralDirOnThisDisk()
+
+
+
+
+
+
+ +

+setTotNoOfEntriesInCentralDirOnThisDisk

+
+public void setTotNoOfEntriesInCentralDirOnThisDisk(long totNoOfEntriesInCentralDirOnThisDisk)
+
+
+
+
+
+
+ +

+getTotNoOfEntriesInCentralDir

+
+public long getTotNoOfEntriesInCentralDir()
+
+
+
+
+
+
+ +

+setTotNoOfEntriesInCentralDir

+
+public void setTotNoOfEntriesInCentralDir(long totNoOfEntriesInCentralDir)
+
+
+
+
+
+
+ +

+getSizeOfCentralDir

+
+public long getSizeOfCentralDir()
+
+
+
+
+
+
+ +

+setSizeOfCentralDir

+
+public void setSizeOfCentralDir(long sizeOfCentralDir)
+
+
+
+
+
+
+ +

+getOffsetStartCenDirWRTStartDiskNo

+
+public long getOffsetStartCenDirWRTStartDiskNo()
+
+
+
+
+
+
+ +

+setOffsetStartCenDirWRTStartDiskNo

+
+public void setOffsetStartCenDirWRTStartDiskNo(long offsetStartCenDirWRTStartDiskNo)
+
+
+
+
+
+
+ +

+getExtensibleDataSector

+
+public byte[] getExtensibleDataSector()
+
+
+
+
+
+
+ +

+setExtensibleDataSector

+
+public void setExtensibleDataSector(byte[] extensibleDataSector)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64ExtendedInfo.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64ExtendedInfo.html new file mode 100644 index 00000000..c2724c70 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/Zip64ExtendedInfo.html @@ -0,0 +1,462 @@ + + + + + + + +Zip64ExtendedInfo (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class Zip64ExtendedInfo

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.Zip64ExtendedInfo
+
+
+
+
public class Zip64ExtendedInfo
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
Zip64ExtendedInfo() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ longgetCompressedSize() + +
+           
+ intgetDiskNumberStart() + +
+           
+ intgetHeader() + +
+           
+ longgetOffsetLocalHeader() + +
+           
+ intgetSize() + +
+           
+ longgetUnCompressedSize() + +
+           
+ voidsetCompressedSize(long compressedSize) + +
+           
+ voidsetDiskNumberStart(int diskNumberStart) + +
+           
+ voidsetHeader(int header) + +
+           
+ voidsetOffsetLocalHeader(long offsetLocalHeader) + +
+           
+ voidsetSize(int size) + +
+           
+ voidsetUnCompressedSize(long unCompressedSize) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Zip64ExtendedInfo

+
+public Zip64ExtendedInfo()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getHeader

+
+public int getHeader()
+
+
+
+
+
+
+ +

+setHeader

+
+public void setHeader(int header)
+
+
+
+
+
+
+ +

+getSize

+
+public int getSize()
+
+
+
+
+
+
+ +

+setSize

+
+public void setSize(int size)
+
+
+
+
+
+
+ +

+getCompressedSize

+
+public long getCompressedSize()
+
+
+
+
+
+
+ +

+setCompressedSize

+
+public void setCompressedSize(long compressedSize)
+
+
+
+
+
+
+ +

+getUnCompressedSize

+
+public long getUnCompressedSize()
+
+
+
+
+
+
+ +

+setUnCompressedSize

+
+public void setUnCompressedSize(long unCompressedSize)
+
+
+
+
+
+
+ +

+getOffsetLocalHeader

+
+public long getOffsetLocalHeader()
+
+
+
+
+
+
+ +

+setOffsetLocalHeader

+
+public void setOffsetLocalHeader(long offsetLocalHeader)
+
+
+
+
+
+
+ +

+getDiskNumberStart

+
+public int getDiskNumberStart()
+
+
+
+
+
+
+ +

+setDiskNumberStart

+
+public void setDiskNumberStart(int diskNumberStart)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/ZipModel.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/ZipModel.html new file mode 100644 index 00000000..417c2868 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/ZipModel.html @@ -0,0 +1,922 @@ + + + + + + + +ZipModel (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class ZipModel

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.ZipModel
+
+
+
All Implemented Interfaces:
Cloneable
+
+
+
+
public class ZipModel
extends Object
implements Cloneable
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ZipModel() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ Objectclone() + +
+           
+ ArchiveExtraDataRecordgetArchiveExtraDataRecord() + +
+           
+ CentralDirectorygetCentralDirectory() + +
+           
+ ListgetDataDescriptorList() + +
+           
+ longgetEnd() + +
+           
+ EndCentralDirRecordgetEndCentralDirRecord() + +
+           
+ StringgetFileNameCharset() + +
+           
+ ListgetLocalFileHeaderList() + +
+           
+ longgetSplitLength() + +
+           
+ longgetStart() + +
+           
+ Zip64EndCentralDirLocatorgetZip64EndCentralDirLocator() + +
+           
+ Zip64EndCentralDirRecordgetZip64EndCentralDirRecord() + +
+           
+ StringgetZipFile() + +
+           
+ booleanisNestedZipFile() + +
+           
+ booleanisSplitArchive() + +
+           
+ booleanisZip64Format() + +
+           
+ voidsetArchiveExtraDataRecord(ArchiveExtraDataRecord archiveExtraDataRecord) + +
+           
+ voidsetCentralDirectory(CentralDirectory centralDirectory) + +
+           
+ voidsetDataDescriptorList(List dataDescriptorList) + +
+           
+ voidsetEnd(long end) + +
+           
+ voidsetEndCentralDirRecord(EndCentralDirRecord endCentralDirRecord) + +
+           
+ voidsetFileNameCharset(String fileNameCharset) + +
+           
+ voidsetLocalFileHeaderList(List localFileHeaderList) + +
+           
+ voidsetNestedZipFile(boolean isNestedZipFile) + +
+           
+ voidsetSplitArchive(boolean splitArchive) + +
+           
+ voidsetSplitLength(long splitLength) + +
+           
+ voidsetStart(long start) + +
+           
+ voidsetZip64EndCentralDirLocator(Zip64EndCentralDirLocator zip64EndCentralDirLocator) + +
+           
+ voidsetZip64EndCentralDirRecord(Zip64EndCentralDirRecord zip64EndCentralDirRecord) + +
+           
+ voidsetZip64Format(boolean isZip64Format) + +
+           
+ voidsetZipFile(String zipFile) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipModel

+
+public ZipModel()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getLocalFileHeaderList

+
+public List getLocalFileHeaderList()
+
+
+
+
+
+
+
+
+
+ +

+setLocalFileHeaderList

+
+public void setLocalFileHeaderList(List localFileHeaderList)
+
+
+
+
+
+
+
+
+
+ +

+getDataDescriptorList

+
+public List getDataDescriptorList()
+
+
+
+
+
+
+
+
+
+ +

+setDataDescriptorList

+
+public void setDataDescriptorList(List dataDescriptorList)
+
+
+
+
+
+
+
+
+
+ +

+getCentralDirectory

+
+public CentralDirectory getCentralDirectory()
+
+
+
+
+
+
+
+
+
+ +

+setCentralDirectory

+
+public void setCentralDirectory(CentralDirectory centralDirectory)
+
+
+
+
+
+
+
+
+
+ +

+getEndCentralDirRecord

+
+public EndCentralDirRecord getEndCentralDirRecord()
+
+
+
+
+
+
+
+
+
+ +

+setEndCentralDirRecord

+
+public void setEndCentralDirRecord(EndCentralDirRecord endCentralDirRecord)
+
+
+
+
+
+
+
+
+
+ +

+getArchiveExtraDataRecord

+
+public ArchiveExtraDataRecord getArchiveExtraDataRecord()
+
+
+
+
+
+
+
+
+
+ +

+setArchiveExtraDataRecord

+
+public void setArchiveExtraDataRecord(ArchiveExtraDataRecord archiveExtraDataRecord)
+
+
+
+
+
+
+
+
+
+ +

+isSplitArchive

+
+public boolean isSplitArchive()
+
+
+
+
+
+
+
+
+
+ +

+setSplitArchive

+
+public void setSplitArchive(boolean splitArchive)
+
+
+
+
+
+
+
+
+
+ +

+getZipFile

+
+public String getZipFile()
+
+
+
+
+
+
+
+
+
+ +

+setZipFile

+
+public void setZipFile(String zipFile)
+
+
+
+
+
+
+
+
+
+ +

+getZip64EndCentralDirLocator

+
+public Zip64EndCentralDirLocator getZip64EndCentralDirLocator()
+
+
+
+
+
+
+
+
+
+ +

+setZip64EndCentralDirLocator

+
+public void setZip64EndCentralDirLocator(Zip64EndCentralDirLocator zip64EndCentralDirLocator)
+
+
+
+
+
+
+
+
+
+ +

+getZip64EndCentralDirRecord

+
+public Zip64EndCentralDirRecord getZip64EndCentralDirRecord()
+
+
+
+
+
+
+
+
+
+ +

+setZip64EndCentralDirRecord

+
+public void setZip64EndCentralDirRecord(Zip64EndCentralDirRecord zip64EndCentralDirRecord)
+
+
+
+
+
+
+
+
+
+ +

+isZip64Format

+
+public boolean isZip64Format()
+
+
+
+
+
+
+
+
+
+ +

+setZip64Format

+
+public void setZip64Format(boolean isZip64Format)
+
+
+
+
+
+
+
+
+
+ +

+isNestedZipFile

+
+public boolean isNestedZipFile()
+
+
+
+
+
+
+
+
+
+ +

+setNestedZipFile

+
+public void setNestedZipFile(boolean isNestedZipFile)
+
+
+
+
+
+
+
+
+
+ +

+getStart

+
+public long getStart()
+
+
+
+
+
+
+
+
+
+ +

+setStart

+
+public void setStart(long start)
+
+
+
+
+
+
+
+
+
+ +

+getEnd

+
+public long getEnd()
+
+
+
+
+
+
+
+
+
+ +

+setEnd

+
+public void setEnd(long end)
+
+
+
+
+
+
+
+
+
+ +

+getSplitLength

+
+public long getSplitLength()
+
+
+
+
+
+
+
+
+
+ +

+setSplitLength

+
+public void setSplitLength(long splitLength)
+
+
+
+
+
+
+
+
+
+ +

+clone

+
+public Object clone()
+             throws CloneNotSupportedException
+
+
+
Overrides:
clone in class Object
+
+
+ +
Throws: +
CloneNotSupportedException
+
+
+
+ +

+getFileNameCharset

+
+public String getFileNameCharset()
+
+
+
+
+
+
+
+
+
+ +

+setFileNameCharset

+
+public void setFileNameCharset(String fileNameCharset)
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/ZipParameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/ZipParameters.html new file mode 100644 index 00000000..0433e00d --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/ZipParameters.html @@ -0,0 +1,908 @@ + + + + + + + +ZipParameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.model +
+Class ZipParameters

+
+java.lang.Object
+  extended by net.lingala.zip4j.model.ZipParameters
+
+
+
All Implemented Interfaces:
Cloneable
+
+
+
+
public class ZipParameters
extends Object
implements Cloneable
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ZipParameters() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ Objectclone() + +
+           
+ intgetAesKeyStrength() + +
+           
+ intgetCompressionLevel() + +
+           
+ intgetCompressionMethod() + +
+           
+ StringgetDefaultFolderPath() + +
+           
+ intgetEncryptionMethod() + +
+           
+ StringgetFileNameInZip() + +
+           
+ char[]getPassword() + +
+           
+ StringgetRootFolderInZip() + +
+           
+ intgetSourceFileCRC() + +
+           
+ TimeZonegetTimeZone() + +
+           
+ booleanisEncryptFiles() + +
+           
+ booleanisIncludeRootFolder() + +
+           
+ booleanisReadHiddenFiles() + +
+           
+ booleanisSourceExternalStream() + +
+           
+ voidsetAesKeyStrength(int aesKeyStrength) + +
+           
+ voidsetCompressionLevel(int compressionLevel) + +
+           
+ voidsetCompressionMethod(int compressionMethod) + +
+           
+ voidsetDefaultFolderPath(String defaultFolderPath) + +
+           
+ voidsetEncryptFiles(boolean encryptFiles) + +
+           
+ voidsetEncryptionMethod(int encryptionMethod) + +
+           
+ voidsetFileNameInZip(String fileNameInZip) + +
+           
+ voidsetIncludeRootFolder(boolean includeRootFolder) + +
+           
+ voidsetPassword(char[] password) + +
+           
+ voidsetPassword(String password) + +
+          Sets the password for the zip file or the file being added
+ Note: For security reasons, usage of this method is discouraged.
+ voidsetReadHiddenFiles(boolean readHiddenFiles) + +
+           
+ voidsetRootFolderInZip(String rootFolderInZip) + +
+           
+ voidsetSourceExternalStream(boolean isSourceExternalStream) + +
+           
+ voidsetSourceFileCRC(int sourceFileCRC) + +
+           
+ voidsetTimeZone(TimeZone timeZone) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipParameters

+
+public ZipParameters()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getCompressionMethod

+
+public int getCompressionMethod()
+
+
+
+
+
+
+
+
+
+ +

+setCompressionMethod

+
+public void setCompressionMethod(int compressionMethod)
+
+
+
+
+
+
+
+
+
+ +

+isEncryptFiles

+
+public boolean isEncryptFiles()
+
+
+
+
+
+
+
+
+
+ +

+setEncryptFiles

+
+public void setEncryptFiles(boolean encryptFiles)
+
+
+
+
+
+
+
+
+
+ +

+getEncryptionMethod

+
+public int getEncryptionMethod()
+
+
+
+
+
+
+
+
+
+ +

+setEncryptionMethod

+
+public void setEncryptionMethod(int encryptionMethod)
+
+
+
+
+
+
+
+
+
+ +

+getCompressionLevel

+
+public int getCompressionLevel()
+
+
+
+
+
+
+
+
+
+ +

+setCompressionLevel

+
+public void setCompressionLevel(int compressionLevel)
+
+
+
+
+
+
+
+
+
+ +

+isReadHiddenFiles

+
+public boolean isReadHiddenFiles()
+
+
+
+
+
+
+
+
+
+ +

+setReadHiddenFiles

+
+public void setReadHiddenFiles(boolean readHiddenFiles)
+
+
+
+
+
+
+
+
+
+ +

+clone

+
+public Object clone()
+             throws CloneNotSupportedException
+
+
+
Overrides:
clone in class Object
+
+
+ +
Throws: +
CloneNotSupportedException
+
+
+
+ +

+getPassword

+
+public char[] getPassword()
+
+
+
+
+
+
+
+
+
+ +

+setPassword

+
+public void setPassword(String password)
+
+
Sets the password for the zip file or the file being added
+ Note: For security reasons, usage of this method is discouraged. Use + setPassword(char[]) instead. As strings are immutable, they cannot be wiped + out from memory explicitly after usage. Therefore, usage of Strings to store + passwords is discouraged. More info here: + http://docs.oracle.com/javase/1.5.0/docs/guide/security/jce/JCERefGuide.html#PBEEx +

+

+
+
+
+
Parameters:
password -
+
+
+
+ +

+setPassword

+
+public void setPassword(char[] password)
+
+
+
+
+
+
+
+
+
+ +

+getAesKeyStrength

+
+public int getAesKeyStrength()
+
+
+
+
+
+
+
+
+
+ +

+setAesKeyStrength

+
+public void setAesKeyStrength(int aesKeyStrength)
+
+
+
+
+
+
+
+
+
+ +

+isIncludeRootFolder

+
+public boolean isIncludeRootFolder()
+
+
+
+
+
+
+
+
+
+ +

+setIncludeRootFolder

+
+public void setIncludeRootFolder(boolean includeRootFolder)
+
+
+
+
+
+
+
+
+
+ +

+getRootFolderInZip

+
+public String getRootFolderInZip()
+
+
+
+
+
+
+
+
+
+ +

+setRootFolderInZip

+
+public void setRootFolderInZip(String rootFolderInZip)
+
+
+
+
+
+
+
+
+
+ +

+getTimeZone

+
+public TimeZone getTimeZone()
+
+
+
+
+
+
+
+
+
+ +

+setTimeZone

+
+public void setTimeZone(TimeZone timeZone)
+
+
+
+
+
+
+
+
+
+ +

+getSourceFileCRC

+
+public int getSourceFileCRC()
+
+
+
+
+
+
+
+
+
+ +

+setSourceFileCRC

+
+public void setSourceFileCRC(int sourceFileCRC)
+
+
+
+
+
+
+
+
+
+ +

+getDefaultFolderPath

+
+public String getDefaultFolderPath()
+
+
+
+
+
+
+
+
+
+ +

+setDefaultFolderPath

+
+public void setDefaultFolderPath(String defaultFolderPath)
+
+
+
+
+
+
+
+
+
+ +

+getFileNameInZip

+
+public String getFileNameInZip()
+
+
+
+
+
+
+
+
+
+ +

+setFileNameInZip

+
+public void setFileNameInZip(String fileNameInZip)
+
+
+
+
+
+
+
+
+
+ +

+isSourceExternalStream

+
+public boolean isSourceExternalStream()
+
+
+
+
+
+
+
+
+
+ +

+setSourceExternalStream

+
+public void setSourceExternalStream(boolean isSourceExternalStream)
+
+
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/AESExtraDataRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/AESExtraDataRecord.html new file mode 100644 index 00000000..8ee38652 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/AESExtraDataRecord.html @@ -0,0 +1,213 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.AESExtraDataRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.AESExtraDataRecord

+
+ + + + + + + + + +
+Packages that use AESExtraDataRecord
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of AESExtraDataRecord in net.lingala.zip4j.model
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model that return AESExtraDataRecord
+ AESExtraDataRecordLocalFileHeader.getAesExtraDataRecord() + +
+           
+ AESExtraDataRecordFileHeader.getAesExtraDataRecord() + +
+           
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type AESExtraDataRecord
+ voidLocalFileHeader.setAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord) + +
+           
+ voidFileHeader.setAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ArchiveExtraDataRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ArchiveExtraDataRecord.html new file mode 100644 index 00000000..9b501179 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ArchiveExtraDataRecord.html @@ -0,0 +1,197 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.ArchiveExtraDataRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.ArchiveExtraDataRecord

+
+ + + + + + + + + +
+Packages that use ArchiveExtraDataRecord
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of ArchiveExtraDataRecord in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return ArchiveExtraDataRecord
+ ArchiveExtraDataRecordZipModel.getArchiveExtraDataRecord() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type ArchiveExtraDataRecord
+ voidZipModel.setArchiveExtraDataRecord(ArchiveExtraDataRecord archiveExtraDataRecord) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/CentralDirectory.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/CentralDirectory.html new file mode 100644 index 00000000..ab5e3426 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/CentralDirectory.html @@ -0,0 +1,197 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.CentralDirectory (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.CentralDirectory

+
+ + + + + + + + + +
+Packages that use CentralDirectory
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of CentralDirectory in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return CentralDirectory
+ CentralDirectoryZipModel.getCentralDirectory() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type CentralDirectory
+ voidZipModel.setCentralDirectory(CentralDirectory centralDirectory) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/DataDescriptor.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/DataDescriptor.html new file mode 100644 index 00000000..7820639d --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/DataDescriptor.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.DataDescriptor (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.DataDescriptor

+
+No usage of net.lingala.zip4j.model.DataDescriptor +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/DigitalSignature.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/DigitalSignature.html new file mode 100644 index 00000000..9f852293 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/DigitalSignature.html @@ -0,0 +1,197 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.DigitalSignature (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.DigitalSignature

+
+ + + + + + + + + +
+Packages that use DigitalSignature
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of DigitalSignature in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return DigitalSignature
+ DigitalSignatureCentralDirectory.getDigitalSignature() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type DigitalSignature
+ voidCentralDirectory.setDigitalSignature(DigitalSignature digitalSignature) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/EndCentralDirRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/EndCentralDirRecord.html new file mode 100644 index 00000000..015fd04d --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/EndCentralDirRecord.html @@ -0,0 +1,197 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.EndCentralDirRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.EndCentralDirRecord

+
+ + + + + + + + + +
+Packages that use EndCentralDirRecord
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of EndCentralDirRecord in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return EndCentralDirRecord
+ EndCentralDirRecordZipModel.getEndCentralDirRecord() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type EndCentralDirRecord
+ voidZipModel.setEndCentralDirRecord(EndCentralDirRecord endCentralDirRecord) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ExtraDataRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ExtraDataRecord.html new file mode 100644 index 00000000..7207ec19 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ExtraDataRecord.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.ExtraDataRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.ExtraDataRecord

+
+No usage of net.lingala.zip4j.model.ExtraDataRecord +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/FileHeader.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/FileHeader.html new file mode 100644 index 00000000..a8cce6ef --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/FileHeader.html @@ -0,0 +1,526 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.FileHeader (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.FileHeader

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use FileHeader
net.lingala.zip4j.core  
net.lingala.zip4j.crypto  
net.lingala.zip4j.io  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
net.lingala.zip4j.util  
+  +

+ + + + + +
+Uses of FileHeader in net.lingala.zip4j.core
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.core that return FileHeader
+ FileHeaderZipFile.getFileHeader(String fileName) + +
+          Returns FileHeader if a file header with the given fileHeader + string exists in the zip model: If not returns null
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.core with parameters of type FileHeader
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters, + String newFileName) + +
+          Extracts a specific file from the zip file to the destination path.
+ ZipInputStreamZipFile.getInputStream(FileHeader fileHeader) + +
+          Returns an input stream for reading the contents of the Zip file corresponding + to the input FileHeader.
+ LocalFileHeaderHeaderReader.readLocalFileHeader(FileHeader fileHeader) + +
+          Reads local file header for the given file header
+ voidZipFile.removeFile(FileHeader fileHeader) + +
+          Removes the file provided in the input file header from the zip file.
+  +

+ + + + + +
+Uses of FileHeader in net.lingala.zip4j.crypto
+  +

+ + + + + + + + +
Constructors in net.lingala.zip4j.crypto with parameters of type FileHeader
StandardDecrypter(FileHeader fileHeader, + byte[] headerBytes) + +
+           
+  +

+ + + + + +
+Uses of FileHeader in net.lingala.zip4j.io
+  +

+ + + + + + + + + +
Fields in net.lingala.zip4j.io declared as FileHeader
+protected  FileHeaderCipherOutputStream.fileHeader + +
+           
+  +

+ + + + + +
+Uses of FileHeader in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return FileHeader
+ FileHeaderUnzipEngineParameters.getFileHeader() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type FileHeader
+ voidUnzipEngineParameters.setFileHeader(FileHeader fileHeader) + +
+           
+  +

+ + + + + +
+Uses of FileHeader in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.unzip that return FileHeader
+ FileHeaderUnzipEngine.getFileHeader() + +
+           
+  +

+ + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.unzip with parameters of type FileHeader
+static voidUnzipUtil.applyFileAttributes(FileHeader fileHeader, + File file) + +
+           
+static voidUnzipUtil.applyFileAttributes(FileHeader fileHeader, + File file, + UnzipParameters unzipParameters) + +
+           
+ voidUnzip.extractFile(FileHeader fileHeader, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ ZipInputStreamUnzip.getInputStream(FileHeader fileHeader) + +
+           
+  +

+ + + + + + + + +
Constructors in net.lingala.zip4j.unzip with parameters of type FileHeader
UnzipEngine(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+  +

+ + + + + +
+Uses of FileHeader in net.lingala.zip4j.util
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.util that return FileHeader
+static FileHeaderZip4jUtil.getFileHeader(ZipModel zipModel, + String fileName) + +
+           
+static FileHeaderZip4jUtil.getFileHeaderWithExactMatch(ZipModel zipModel, + String fileName) + +
+           
+  +

+ + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.util with parameters of type FileHeader
+static intZip4jUtil.getIndexOfFileHeader(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+ voidArchiveMaintainer.initProgressMonitorForRemoveOp(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ HashMapArchiveMaintainer.initRemoveZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ HashMapArchiveMaintainer.removeZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/LocalFileHeader.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/LocalFileHeader.html new file mode 100644 index 00000000..47d88dfd --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/LocalFileHeader.html @@ -0,0 +1,354 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.LocalFileHeader (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.LocalFileHeader

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use LocalFileHeader
net.lingala.zip4j.core  
net.lingala.zip4j.crypto  
net.lingala.zip4j.io  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
+  +

+ + + + + +
+Uses of LocalFileHeader in net.lingala.zip4j.core
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.core that return LocalFileHeader
+ LocalFileHeaderHeaderReader.readLocalFileHeader(FileHeader fileHeader) + +
+          Reads local file header for the given file header
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.core with parameters of type LocalFileHeader
+ voidHeaderWriter.updateLocalFileHeader(LocalFileHeader localFileHeader, + long offset, + int toUpdate, + ZipModel zipModel, + byte[] bytesToWrite, + int noOfDisk, + SplitOutputStream outputStream) + +
+           
+ intHeaderWriter.writeExtendedLocalHeader(LocalFileHeader localFileHeader, + OutputStream outputStream) + +
+           
+ intHeaderWriter.writeLocalFileHeader(ZipModel zipModel, + LocalFileHeader localFileHeader, + OutputStream outputStream) + +
+           
+  +

+ + + + + +
+Uses of LocalFileHeader in net.lingala.zip4j.crypto
+  +

+ + + + + + + + +
Constructors in net.lingala.zip4j.crypto with parameters of type LocalFileHeader
AESDecrypter(LocalFileHeader localFileHeader, + byte[] salt, + byte[] passwordVerifier) + +
+           
+  +

+ + + + + +
+Uses of LocalFileHeader in net.lingala.zip4j.io
+  +

+ + + + + + + + + +
Fields in net.lingala.zip4j.io declared as LocalFileHeader
+protected  LocalFileHeaderCipherOutputStream.localFileHeader + +
+           
+  +

+ + + + + +
+Uses of LocalFileHeader in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return LocalFileHeader
+ LocalFileHeaderUnzipEngineParameters.getLocalFileHeader() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type LocalFileHeader
+ voidUnzipEngineParameters.setLocalFileHeader(LocalFileHeader localFileHeader) + +
+           
+  +

+ + + + + +
+Uses of LocalFileHeader in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.unzip that return LocalFileHeader
+ LocalFileHeaderUnzipEngine.getLocalFileHeader() + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/UnzipEngineParameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/UnzipEngineParameters.html new file mode 100644 index 00000000..fec62546 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/UnzipEngineParameters.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.UnzipEngineParameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.UnzipEngineParameters

+
+No usage of net.lingala.zip4j.model.UnzipEngineParameters +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/UnzipParameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/UnzipParameters.html new file mode 100644 index 00000000..a49bdc33 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/UnzipParameters.html @@ -0,0 +1,338 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.UnzipParameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.UnzipParameters

+
+ + + + + + + + + + + + + + + + + +
+Packages that use UnzipParameters
net.lingala.zip4j.core  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
+  +

+ + + + + +
+Uses of UnzipParameters in net.lingala.zip4j.core
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.core with parameters of type UnzipParameters
+ voidZipFile.extractAll(String destPath, + UnzipParameters unzipParameters) + +
+          Extracts all the files in the given zip file to the input destination path.
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(FileHeader fileHeader, + String destPath, + UnzipParameters unzipParameters, + String newFileName) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(String fileName, + String destPath, + UnzipParameters unzipParameters) + +
+          Extracts a specific file from the zip file to the destination path.
+ voidZipFile.extractFile(String fileName, + String destPath, + UnzipParameters unzipParameters, + String newFileName) + +
+          Extracts a specific file from the zip file to the destination path.
+  +

+ + + + + +
+Uses of UnzipParameters in net.lingala.zip4j.model
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type UnzipParameters
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters.
+  +

+ + + + + +
+Uses of UnzipParameters in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.unzip with parameters of type UnzipParameters
+static voidUnzipUtil.applyFileAttributes(FileHeader fileHeader, + File file, + UnzipParameters unzipParameters) + +
+           
+ voidUnzip.extractAll(UnzipParameters unzipParameters, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidUnzip.extractFile(FileHeader fileHeader, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidUnzipEngine.unzipFile(ProgressMonitor progressMonitor, + String outPath, + String newFileName, + UnzipParameters unzipParameters) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64EndCentralDirLocator.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64EndCentralDirLocator.html new file mode 100644 index 00000000..498084e9 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64EndCentralDirLocator.html @@ -0,0 +1,197 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.Zip64EndCentralDirLocator (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.Zip64EndCentralDirLocator

+
+ + + + + + + + + +
+Packages that use Zip64EndCentralDirLocator
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of Zip64EndCentralDirLocator in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return Zip64EndCentralDirLocator
+ Zip64EndCentralDirLocatorZipModel.getZip64EndCentralDirLocator() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type Zip64EndCentralDirLocator
+ voidZipModel.setZip64EndCentralDirLocator(Zip64EndCentralDirLocator zip64EndCentralDirLocator) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64EndCentralDirRecord.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64EndCentralDirRecord.html new file mode 100644 index 00000000..eb919c85 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64EndCentralDirRecord.html @@ -0,0 +1,197 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.Zip64EndCentralDirRecord (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.Zip64EndCentralDirRecord

+
+ + + + + + + + + +
+Packages that use Zip64EndCentralDirRecord
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of Zip64EndCentralDirRecord in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return Zip64EndCentralDirRecord
+ Zip64EndCentralDirRecordZipModel.getZip64EndCentralDirRecord() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type Zip64EndCentralDirRecord
+ voidZipModel.setZip64EndCentralDirRecord(Zip64EndCentralDirRecord zip64EndCentralDirRecord) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64ExtendedInfo.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64ExtendedInfo.html new file mode 100644 index 00000000..74ad67b0 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/Zip64ExtendedInfo.html @@ -0,0 +1,213 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.Zip64ExtendedInfo (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.Zip64ExtendedInfo

+
+ + + + + + + + + +
+Packages that use Zip64ExtendedInfo
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of Zip64ExtendedInfo in net.lingala.zip4j.model
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model that return Zip64ExtendedInfo
+ Zip64ExtendedInfoLocalFileHeader.getZip64ExtendedInfo() + +
+           
+ Zip64ExtendedInfoFileHeader.getZip64ExtendedInfo() + +
+           
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type Zip64ExtendedInfo
+ voidLocalFileHeader.setZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo) + +
+           
+ voidFileHeader.setZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ZipModel.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ZipModel.html new file mode 100644 index 00000000..055ac93a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ZipModel.html @@ -0,0 +1,573 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.ZipModel (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.ZipModel

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use ZipModel
net.lingala.zip4j.core  
net.lingala.zip4j.io  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
net.lingala.zip4j.util  
net.lingala.zip4j.zip  
+  +

+ + + + + +
+Uses of ZipModel in net.lingala.zip4j.core
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.core that return ZipModel
+ ZipModelHeaderReader.readAllHeaders() + +
+          Reads all the header information for the zip file.
+ ZipModelHeaderReader.readAllHeaders(String fileNameCharset) + +
+          Reads all the header information for the zip file.
+  +

+ + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.core with parameters of type ZipModel
+ voidHeaderWriter.finalizeZipFile(ZipModel zipModel, + OutputStream outputStream) + +
+          Processes zip header data and writes this data to the zip file
+ voidHeaderWriter.finalizeZipFileWithoutValidations(ZipModel zipModel, + OutputStream outputStream) + +
+          Processes zip header data and writes this data to the zip file without any validations.
+ voidHeaderWriter.updateLocalFileHeader(LocalFileHeader localFileHeader, + long offset, + int toUpdate, + ZipModel zipModel, + byte[] bytesToWrite, + int noOfDisk, + SplitOutputStream outputStream) + +
+           
+ intHeaderWriter.writeLocalFileHeader(ZipModel zipModel, + LocalFileHeader localFileHeader, + OutputStream outputStream) + +
+           
+  +

+ + + + + +
+Uses of ZipModel in net.lingala.zip4j.io
+  +

+ + + + + + + + + +
Fields in net.lingala.zip4j.io declared as ZipModel
+protected  ZipModelCipherOutputStream.zipModel + +
+           
+  +

+ + + + + + + + + + + + + + +
Constructors in net.lingala.zip4j.io with parameters of type ZipModel
CipherOutputStream(OutputStream outputStream, + ZipModel zipModel) + +
+           
DeflaterOutputStream(OutputStream outputStream, + ZipModel zipModel) + +
+           
ZipOutputStream(OutputStream outputStream, + ZipModel zipModel) + +
+           
+  +

+ + + + + +
+Uses of ZipModel in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return ZipModel
+ ZipModelUnzipEngineParameters.getZipModel() + +
+           
+  +

+ + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type ZipModel
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters.
+ voidUnzipEngineParameters.setZipModel(ZipModel zipModel) + +
+           
+  +

+ + + + + +
+Uses of ZipModel in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.unzip that return ZipModel
+ ZipModelUnzipEngine.getZipModel() + +
+           
+  +

+ + + + + + + + + + + +
Constructors in net.lingala.zip4j.unzip with parameters of type ZipModel
Unzip(ZipModel zipModel) + +
+           
UnzipEngine(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+  +

+ + + + + +
+Uses of ZipModel in net.lingala.zip4j.util
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.util with parameters of type ZipModel
+static FileHeaderZip4jUtil.getFileHeader(ZipModel zipModel, + String fileName) + +
+           
+static FileHeaderZip4jUtil.getFileHeaderWithExactMatch(ZipModel zipModel, + String fileName) + +
+           
+static intZip4jUtil.getIndexOfFileHeader(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+static ArrayListZip4jUtil.getSplitZipFiles(ZipModel zipModel) + +
+           
+ voidArchiveMaintainer.initProgressMonitorForMergeOp(ZipModel zipModel, + ProgressMonitor progressMonitor) + +
+           
+ voidArchiveMaintainer.initProgressMonitorForRemoveOp(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ HashMapArchiveMaintainer.initRemoveZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ voidArchiveMaintainer.mergeSplitZipFiles(ZipModel zipModel, + File outputZipFile, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Merges split Zip files into a single Zip file
+ HashMapArchiveMaintainer.removeZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidArchiveMaintainer.setComment(ZipModel zipModel, + String comment) + +
+           
+  +

+ + + + + +
+Uses of ZipModel in net.lingala.zip4j.zip
+  +

+ + + + + + + + +
Constructors in net.lingala.zip4j.zip with parameters of type ZipModel
ZipEngine(ZipModel zipModel) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ZipParameters.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ZipParameters.html new file mode 100644 index 00000000..6a51204e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/class-use/ZipParameters.html @@ -0,0 +1,388 @@ + + + + + + + +Uses of Class net.lingala.zip4j.model.ZipParameters (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.model.ZipParameters

+
+ + + + + + + + + + + + + + + + + +
+Packages that use ZipParameters
net.lingala.zip4j.core  
net.lingala.zip4j.io  
net.lingala.zip4j.zip  
+  +

+ + + + + +
+Uses of ZipParameters in net.lingala.zip4j.core
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.core with parameters of type ZipParameters
+ voidZipFile.addFile(File sourceFile, + ZipParameters parameters) + +
+          Adds input source file to the zip file.
+ voidZipFile.addFiles(ArrayList sourceFileList, + ZipParameters parameters) + +
+          Adds the list of input files to the zip file.
+ voidZipFile.addFolder(File path, + ZipParameters parameters) + +
+          Adds the folder in the given file object to the zip file.
+ voidZipFile.addFolder(String path, + ZipParameters parameters) + +
+          Adds the folder in the given path to the zip file.
+ voidZipFile.addStream(InputStream inputStream, + ZipParameters parameters) + +
+          Creates a new entry in the zip file and adds the content of the inputstream to the + zip file.
+ voidZipFile.createZipFile(ArrayList sourceFileList, + ZipParameters parameters) + +
+          Creates a zip file and adds the list of source file(s) to the zip file.
+ voidZipFile.createZipFile(ArrayList sourceFileList, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the list of source file(s) to the zip file.
+ voidZipFile.createZipFile(File sourceFile, + ZipParameters parameters) + +
+          Creates a zip file and adds the source file to the zip file.
+ voidZipFile.createZipFile(File sourceFile, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the source file to the zip file.
+ voidZipFile.createZipFileFromFolder(File folderToAdd, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the files/folders from the specified folder to the zip file.
+ voidZipFile.createZipFileFromFolder(String folderToAdd, + ZipParameters parameters, + boolean splitArchive, + long splitLength) + +
+          Creates a zip file and adds the files/folders from the specified folder to the zip file.
+  +

+ + + + + +
+Uses of ZipParameters in net.lingala.zip4j.io
+  +

+ + + + + + + + + +
Fields in net.lingala.zip4j.io declared as ZipParameters
+protected  ZipParametersCipherOutputStream.zipParameters + +
+           
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.io with parameters of type ZipParameters
+ voidDeflaterOutputStream.putNextEntry(File file, + ZipParameters zipParameters) + +
+           
+ voidCipherOutputStream.putNextEntry(File file, + ZipParameters zipParameters) + +
+           
+  +

+ + + + + +
+Uses of ZipParameters in net.lingala.zip4j.zip
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.zip with parameters of type ZipParameters
+ voidZipEngine.addFiles(ArrayList fileList, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidZipEngine.addFolderToZip(File file, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidZipEngine.addStreamToZip(InputStream inputStream, + ZipParameters parameters) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-frame.html new file mode 100644 index 00000000..1fa9f11e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-frame.html @@ -0,0 +1,63 @@ + + + + + + + +net.lingala.zip4j.model (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.model + + + + +
+Classes  + +
+AESExtraDataRecord +
+ArchiveExtraDataRecord +
+CentralDirectory +
+DataDescriptor +
+DigitalSignature +
+EndCentralDirRecord +
+ExtraDataRecord +
+FileHeader +
+LocalFileHeader +
+UnzipEngineParameters +
+UnzipParameters +
+Zip64EndCentralDirLocator +
+Zip64EndCentralDirRecord +
+Zip64ExtendedInfo +
+ZipModel +
+ZipParameters
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-summary.html new file mode 100644 index 00000000..162ee03c --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-summary.html @@ -0,0 +1,218 @@ + + + + + + + +net.lingala.zip4j.model (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.model +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
AESExtraDataRecord 
ArchiveExtraDataRecord 
CentralDirectory 
DataDescriptor 
DigitalSignature 
EndCentralDirRecord 
ExtraDataRecord 
FileHeader 
LocalFileHeader 
UnzipEngineParameters 
UnzipParameters 
Zip64EndCentralDirLocator 
Zip64EndCentralDirRecord 
Zip64ExtendedInfo 
ZipModel 
ZipParameters 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-tree.html new file mode 100644 index 00000000..f010160c --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-tree.html @@ -0,0 +1,156 @@ + + + + + + + +net.lingala.zip4j.model Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.model +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/model/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-use.html new file mode 100644 index 00000000..66e7453b --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/model/package-use.html @@ -0,0 +1,429 @@ + + + + + + + +Uses of Package net.lingala.zip4j.model (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.model

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use net.lingala.zip4j.model
net.lingala.zip4j.core  
net.lingala.zip4j.crypto  
net.lingala.zip4j.io  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
net.lingala.zip4j.util  
net.lingala.zip4j.zip  
+  +

+ + + + + + + + + + + + + + + + + + + + +
+Classes in net.lingala.zip4j.model used by net.lingala.zip4j.core
FileHeader + +
+           
LocalFileHeader + +
+           
UnzipParameters + +
+           
ZipModel + +
+           
ZipParameters + +
+           
+  +

+ + + + + + + + + + + +
+Classes in net.lingala.zip4j.model used by net.lingala.zip4j.crypto
FileHeader + +
+           
LocalFileHeader + +
+           
+  +

+ + + + + + + + + + + + + + + + + +
+Classes in net.lingala.zip4j.model used by net.lingala.zip4j.io
FileHeader + +
+           
LocalFileHeader + +
+           
ZipModel + +
+           
ZipParameters + +
+           
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Classes in net.lingala.zip4j.model used by net.lingala.zip4j.model
AESExtraDataRecord + +
+           
ArchiveExtraDataRecord + +
+           
CentralDirectory + +
+           
DigitalSignature + +
+           
EndCentralDirRecord + +
+           
FileHeader + +
+           
LocalFileHeader + +
+           
UnzipParameters + +
+           
Zip64EndCentralDirLocator + +
+           
Zip64EndCentralDirRecord + +
+           
Zip64ExtendedInfo + +
+           
ZipModel + +
+           
+  +

+ + + + + + + + + + + + + + + + + +
+Classes in net.lingala.zip4j.model used by net.lingala.zip4j.unzip
FileHeader + +
+           
LocalFileHeader + +
+           
UnzipParameters + +
+           
ZipModel + +
+           
+  +

+ + + + + + + + + + + +
+Classes in net.lingala.zip4j.model used by net.lingala.zip4j.util
FileHeader + +
+           
ZipModel + +
+           
+  +

+ + + + + + + + + + + +
+Classes in net.lingala.zip4j.model used by net.lingala.zip4j.zip
ZipModel + +
+           
ZipParameters + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/progress/ProgressMonitor.html b/lib/zip4j/javadoc/net/lingala/zip4j/progress/ProgressMonitor.html new file mode 100644 index 00000000..435f3c7c --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/progress/ProgressMonitor.html @@ -0,0 +1,934 @@ + + + + + + + +ProgressMonitor (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.progress +
+Class ProgressMonitor

+
+java.lang.Object
+  extended by net.lingala.zip4j.progress.ProgressMonitor
+
+
+
+
public class ProgressMonitor
extends Object
+ + +

+If Zip4j is set to run in thread mode, this class helps retrieve current progress +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intOPERATION_ADD + +
+           
+static intOPERATION_CALC_CRC + +
+           
+static intOPERATION_EXTRACT + +
+           
+static intOPERATION_MERGE + +
+           
+static intOPERATION_NONE + +
+           
+static intOPERATION_REMOVE + +
+           
+static intRESULT_CANCELLED + +
+           
+static intRESULT_ERROR + +
+           
+static intRESULT_SUCCESS + +
+           
+static intRESULT_WORKING + +
+           
+static intSTATE_BUSY + +
+           
+static intSTATE_READY + +
+           
+  + + + + + + + + + + +
+Constructor Summary
ProgressMonitor() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidcancelAllTasks() + +
+           
+ voidendProgressMonitorError(Throwable e) + +
+           
+ voidendProgressMonitorSuccess() + +
+           
+ voidfullReset() + +
+           
+ intgetCurrentOperation() + +
+           
+ ThrowablegetException() + +
+           
+ StringgetFileName() + +
+           
+ intgetPercentDone() + +
+           
+ intgetResult() + +
+           
+ intgetState() + +
+           
+ longgetTotalWork() + +
+           
+ longgetWorkCompleted() + +
+           
+ booleanisCancelAllTasks() + +
+           
+ booleanisPause() + +
+           
+ voidreset() + +
+           
+ voidsetCurrentOperation(int currentOperation) + +
+           
+ voidsetException(Throwable exception) + +
+           
+ voidsetFileName(String fileName) + +
+           
+ voidsetPause(boolean pause) + +
+           
+ voidsetPercentDone(int percentDone) + +
+           
+ voidsetResult(int result) + +
+           
+ voidsetState(int state) + +
+           
+ voidsetTotalWork(long totalWork) + +
+           
+ voidupdateWorkCompleted(long workCompleted) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+STATE_READY

+
+public static final int STATE_READY
+
+
+
See Also:
Constant Field Values
+
+
+ +

+STATE_BUSY

+
+public static final int STATE_BUSY
+
+
+
See Also:
Constant Field Values
+
+
+ +

+RESULT_SUCCESS

+
+public static final int RESULT_SUCCESS
+
+
+
See Also:
Constant Field Values
+
+
+ +

+RESULT_WORKING

+
+public static final int RESULT_WORKING
+
+
+
See Also:
Constant Field Values
+
+
+ +

+RESULT_ERROR

+
+public static final int RESULT_ERROR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+RESULT_CANCELLED

+
+public static final int RESULT_CANCELLED
+
+
+
See Also:
Constant Field Values
+
+
+ +

+OPERATION_NONE

+
+public static final int OPERATION_NONE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+OPERATION_ADD

+
+public static final int OPERATION_ADD
+
+
+
See Also:
Constant Field Values
+
+
+ +

+OPERATION_EXTRACT

+
+public static final int OPERATION_EXTRACT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+OPERATION_REMOVE

+
+public static final int OPERATION_REMOVE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+OPERATION_CALC_CRC

+
+public static final int OPERATION_CALC_CRC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+OPERATION_MERGE

+
+public static final int OPERATION_MERGE
+
+
+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+ProgressMonitor

+
+public ProgressMonitor()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getState

+
+public int getState()
+
+
+
+
+
+
+ +

+setState

+
+public void setState(int state)
+
+
+
+
+
+
+ +

+getTotalWork

+
+public long getTotalWork()
+
+
+
+
+
+
+ +

+setTotalWork

+
+public void setTotalWork(long totalWork)
+
+
+
+
+
+
+ +

+getWorkCompleted

+
+public long getWorkCompleted()
+
+
+
+
+
+
+ +

+updateWorkCompleted

+
+public void updateWorkCompleted(long workCompleted)
+
+
+
+
+
+
+ +

+getPercentDone

+
+public int getPercentDone()
+
+
+
+
+
+
+ +

+setPercentDone

+
+public void setPercentDone(int percentDone)
+
+
+
+
+
+
+ +

+getResult

+
+public int getResult()
+
+
+
+
+
+
+ +

+setResult

+
+public void setResult(int result)
+
+
+
+
+
+
+ +

+getFileName

+
+public String getFileName()
+
+
+
+
+
+
+ +

+setFileName

+
+public void setFileName(String fileName)
+
+
+
+
+
+
+ +

+getCurrentOperation

+
+public int getCurrentOperation()
+
+
+
+
+
+
+ +

+setCurrentOperation

+
+public void setCurrentOperation(int currentOperation)
+
+
+
+
+
+
+ +

+getException

+
+public Throwable getException()
+
+
+
+
+
+
+ +

+setException

+
+public void setException(Throwable exception)
+
+
+
+
+
+
+ +

+endProgressMonitorSuccess

+
+public void endProgressMonitorSuccess()
+                               throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+endProgressMonitorError

+
+public void endProgressMonitorError(Throwable e)
+                             throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+reset

+
+public void reset()
+
+
+
+
+
+
+ +

+fullReset

+
+public void fullReset()
+
+
+
+
+
+
+ +

+isCancelAllTasks

+
+public boolean isCancelAllTasks()
+
+
+
+
+
+
+ +

+cancelAllTasks

+
+public void cancelAllTasks()
+
+
+
+
+
+
+ +

+isPause

+
+public boolean isPause()
+
+
+
+
+
+
+ +

+setPause

+
+public void setPause(boolean pause)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/progress/class-use/ProgressMonitor.html b/lib/zip4j/javadoc/net/lingala/zip4j/progress/class-use/ProgressMonitor.html new file mode 100644 index 00000000..ec068a9a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/progress/class-use/ProgressMonitor.html @@ -0,0 +1,420 @@ + + + + + + + +Uses of Class net.lingala.zip4j.progress.ProgressMonitor (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.progress.ProgressMonitor

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use ProgressMonitor
net.lingala.zip4j.core  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
net.lingala.zip4j.util  
net.lingala.zip4j.zip  
+  +

+ + + + + +
+Uses of ProgressMonitor in net.lingala.zip4j.core
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.core that return ProgressMonitor
+ ProgressMonitorZipFile.getProgressMonitor() + +
+           
+  +

+ + + + + +
+Uses of ProgressMonitor in net.lingala.zip4j.model
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type ProgressMonitor
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters
+ voidFileHeader.extractFile(ZipModel zipModel, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Extracts file to the specified directory using any + user defined parameters in UnzipParameters.
+  +

+ + + + + +
+Uses of ProgressMonitor in net.lingala.zip4j.unzip
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.unzip with parameters of type ProgressMonitor
+ voidUnzip.extractAll(UnzipParameters unzipParameters, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidUnzip.extractFile(FileHeader fileHeader, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidUnzipEngine.unzipFile(ProgressMonitor progressMonitor, + String outPath, + String newFileName, + UnzipParameters unzipParameters) + +
+           
+  +

+ + + + + +
+Uses of ProgressMonitor in net.lingala.zip4j.util
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.util with parameters of type ProgressMonitor
+static longCRCUtil.computeFileCRC(String inputFile, + ProgressMonitor progressMonitor) + +
+          Calculates CRC of a file
+ voidArchiveMaintainer.initProgressMonitorForMergeOp(ZipModel zipModel, + ProgressMonitor progressMonitor) + +
+           
+ voidArchiveMaintainer.initProgressMonitorForRemoveOp(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ HashMapArchiveMaintainer.initRemoveZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ voidArchiveMaintainer.mergeSplitZipFiles(ZipModel zipModel, + File outputZipFile, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Merges split Zip files into a single Zip file
+ HashMapArchiveMaintainer.removeZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+  +

+ + + + + +
+Uses of ProgressMonitor in net.lingala.zip4j.zip
+  +

+ + + + + + + + + + + + + +
Methods in net.lingala.zip4j.zip with parameters of type ProgressMonitor
+ voidZipEngine.addFiles(ArrayList fileList, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidZipEngine.addFolderToZip(File file, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-frame.html new file mode 100644 index 00000000..116693dd --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-frame.html @@ -0,0 +1,33 @@ + + + + + + + +net.lingala.zip4j.progress (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.progress + + + + +
+Classes  + +
+ProgressMonitor
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-summary.html new file mode 100644 index 00000000..760d1eb7 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-summary.html @@ -0,0 +1,158 @@ + + + + + + + +net.lingala.zip4j.progress (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.progress +

+ + + + + + + + + +
+Class Summary
ProgressMonitorIf Zip4j is set to run in thread mode, this class helps retrieve current progress
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-tree.html new file mode 100644 index 00000000..1eecd7ec --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-tree.html @@ -0,0 +1,154 @@ + + + + + + + +net.lingala.zip4j.progress Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.progress +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-use.html new file mode 100644 index 00000000..442b5abf --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/progress/package-use.html @@ -0,0 +1,247 @@ + + + + + + + +Uses of Package net.lingala.zip4j.progress (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.progress

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages that use net.lingala.zip4j.progress
net.lingala.zip4j.core  
net.lingala.zip4j.model  
net.lingala.zip4j.unzip  
net.lingala.zip4j.util  
net.lingala.zip4j.zip  
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.progress used by net.lingala.zip4j.core
ProgressMonitor + +
+          If Zip4j is set to run in thread mode, this class helps retrieve current progress
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.progress used by net.lingala.zip4j.model
ProgressMonitor + +
+          If Zip4j is set to run in thread mode, this class helps retrieve current progress
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.progress used by net.lingala.zip4j.unzip
ProgressMonitor + +
+          If Zip4j is set to run in thread mode, this class helps retrieve current progress
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.progress used by net.lingala.zip4j.util
ProgressMonitor + +
+          If Zip4j is set to run in thread mode, this class helps retrieve current progress
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.progress used by net.lingala.zip4j.zip
ProgressMonitor + +
+          If Zip4j is set to run in thread mode, this class helps retrieve current progress
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/Unzip.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/Unzip.html new file mode 100644 index 00000000..8e2cadac --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/Unzip.html @@ -0,0 +1,321 @@ + + + + + + + +Unzip (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.unzip +
+Class Unzip

+
+java.lang.Object
+  extended by net.lingala.zip4j.unzip.Unzip
+
+
+
+
public class Unzip
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
Unzip(ZipModel zipModel) + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidextractAll(UnzipParameters unzipParameters, + String outPath, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidextractFile(FileHeader fileHeader, + String outPath, + UnzipParameters unzipParameters, + String newFileName, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ ZipInputStreamgetInputStream(FileHeader fileHeader) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Unzip

+
+public Unzip(ZipModel zipModel)
+      throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+extractAll

+
+public void extractAll(UnzipParameters unzipParameters,
+                       String outPath,
+                       ProgressMonitor progressMonitor,
+                       boolean runInThread)
+                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+extractFile

+
+public void extractFile(FileHeader fileHeader,
+                        String outPath,
+                        UnzipParameters unzipParameters,
+                        String newFileName,
+                        ProgressMonitor progressMonitor,
+                        boolean runInThread)
+                 throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getInputStream

+
+public ZipInputStream getInputStream(FileHeader fileHeader)
+                              throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/UnzipEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/UnzipEngine.html new file mode 100644 index 00000000..942deed9 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/UnzipEngine.html @@ -0,0 +1,455 @@ + + + + + + + +UnzipEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.unzip +
+Class UnzipEngine

+
+java.lang.Object
+  extended by net.lingala.zip4j.unzip.UnzipEngine
+
+
+
+
public class UnzipEngine
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
UnzipEngine(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidcheckCRC() + +
+           
+ IDecryptergetDecrypter() + +
+           
+ FileHeadergetFileHeader() + +
+           
+ ZipInputStreamgetInputStream() + +
+           
+ LocalFileHeadergetLocalFileHeader() + +
+           
+ ZipModelgetZipModel() + +
+           
+ RandomAccessFilestartNextSplitFile() + +
+           
+ voidunzipFile(ProgressMonitor progressMonitor, + String outPath, + String newFileName, + UnzipParameters unzipParameters) + +
+           
+ voidupdateCRC(byte[] buff, + int offset, + int len) + +
+           
+ voidupdateCRC(int b) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+UnzipEngine

+
+public UnzipEngine(ZipModel zipModel,
+                   FileHeader fileHeader)
+            throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+unzipFile

+
+public void unzipFile(ProgressMonitor progressMonitor,
+                      String outPath,
+                      String newFileName,
+                      UnzipParameters unzipParameters)
+               throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getInputStream

+
+public ZipInputStream getInputStream()
+                              throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+checkCRC

+
+public void checkCRC()
+              throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+startNextSplitFile

+
+public RandomAccessFile startNextSplitFile()
+                                    throws IOException,
+                                           FileNotFoundException
+
+
+ +
Throws: +
IOException +
FileNotFoundException
+
+
+
+ +

+updateCRC

+
+public void updateCRC(int b)
+
+
+
+
+
+
+ +

+updateCRC

+
+public void updateCRC(byte[] buff,
+                      int offset,
+                      int len)
+
+
+
+
+
+
+ +

+getFileHeader

+
+public FileHeader getFileHeader()
+
+
+
+
+
+
+ +

+getDecrypter

+
+public IDecrypter getDecrypter()
+
+
+
+
+
+
+ +

+getZipModel

+
+public ZipModel getZipModel()
+
+
+
+
+
+
+ +

+getLocalFileHeader

+
+public LocalFileHeader getLocalFileHeader()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/UnzipUtil.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/UnzipUtil.html new file mode 100644 index 00000000..79410aa7 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/UnzipUtil.html @@ -0,0 +1,284 @@ + + + + + + + +UnzipUtil (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.unzip +
+Class UnzipUtil

+
+java.lang.Object
+  extended by net.lingala.zip4j.unzip.UnzipUtil
+
+
+
+
public class UnzipUtil
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
UnzipUtil() + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+static voidapplyFileAttributes(FileHeader fileHeader, + File file) + +
+           
+static voidapplyFileAttributes(FileHeader fileHeader, + File file, + UnzipParameters unzipParameters) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+UnzipUtil

+
+public UnzipUtil()
+
+
+ + + + + + + + +
+Method Detail
+ +

+applyFileAttributes

+
+public static void applyFileAttributes(FileHeader fileHeader,
+                                       File file)
+                                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+applyFileAttributes

+
+public static void applyFileAttributes(FileHeader fileHeader,
+                                       File file,
+                                       UnzipParameters unzipParameters)
+                                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/Unzip.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/Unzip.html new file mode 100644 index 00000000..250f712f --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/Unzip.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.unzip.Unzip (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.unzip.Unzip

+
+No usage of net.lingala.zip4j.unzip.Unzip +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/UnzipEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/UnzipEngine.html new file mode 100644 index 00000000..3d7eca06 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/UnzipEngine.html @@ -0,0 +1,268 @@ + + + + + + + +Uses of Class net.lingala.zip4j.unzip.UnzipEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.unzip.UnzipEngine

+
+ + + + + + + + + + + + + +
+Packages that use UnzipEngine
net.lingala.zip4j.io  
net.lingala.zip4j.model  
+  +

+ + + + + +
+Uses of UnzipEngine in net.lingala.zip4j.io
+  +

+ + + + + + + + + + + + + + + + + +
Methods in net.lingala.zip4j.io that return UnzipEngine
+ UnzipEnginePartInputStream.getUnzipEngine() + +
+           
+ UnzipEngineInflaterInputStream.getUnzipEngine() + +
+           
+ UnzipEngineBaseInputStream.getUnzipEngine() + +
+           
+  +

+ + + + + + + + + + + +
Constructors in net.lingala.zip4j.io with parameters of type UnzipEngine
InflaterInputStream(RandomAccessFile raf, + long start, + long len, + UnzipEngine unzipEngine) + +
+           
PartInputStream(RandomAccessFile raf, + long start, + long len, + UnzipEngine unzipEngine) + +
+           
+  +

+ + + + + +
+Uses of UnzipEngine in net.lingala.zip4j.model
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model that return UnzipEngine
+ UnzipEngineUnzipEngineParameters.getUnzipEngine() + +
+           
+  +

+ + + + + + + + + +
Methods in net.lingala.zip4j.model with parameters of type UnzipEngine
+ voidUnzipEngineParameters.setUnzipEngine(UnzipEngine unzipEngine) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/UnzipUtil.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/UnzipUtil.html new file mode 100644 index 00000000..67a328d8 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/class-use/UnzipUtil.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.unzip.UnzipUtil (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.unzip.UnzipUtil

+
+No usage of net.lingala.zip4j.unzip.UnzipUtil +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-frame.html new file mode 100644 index 00000000..4f9bde1d --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-frame.html @@ -0,0 +1,37 @@ + + + + + + + +net.lingala.zip4j.unzip (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.unzip + + + + +
+Classes  + +
+Unzip +
+UnzipEngine +
+UnzipUtil
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-summary.html new file mode 100644 index 00000000..01ee5763 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-summary.html @@ -0,0 +1,166 @@ + + + + + + + +net.lingala.zip4j.unzip (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.unzip +

+ + + + + + + + + + + + + + + + + +
+Class Summary
Unzip 
UnzipEngine 
UnzipUtil 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-tree.html new file mode 100644 index 00000000..e8b1977f --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-tree.html @@ -0,0 +1,154 @@ + + + + + + + +net.lingala.zip4j.unzip Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.unzip +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-use.html new file mode 100644 index 00000000..b8da6327 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/unzip/package-use.html @@ -0,0 +1,190 @@ + + + + + + + +Uses of Package net.lingala.zip4j.unzip (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.unzip

+
+ + + + + + + + + + + + + +
+Packages that use net.lingala.zip4j.unzip
net.lingala.zip4j.io  
net.lingala.zip4j.model  
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.unzip used by net.lingala.zip4j.io
UnzipEngine + +
+           
+  +

+ + + + + + + + +
+Classes in net.lingala.zip4j.unzip used by net.lingala.zip4j.model
UnzipEngine + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/ArchiveMaintainer.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/ArchiveMaintainer.html new file mode 100644 index 00000000..d540d965 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/ArchiveMaintainer.html @@ -0,0 +1,392 @@ + + + + + + + +ArchiveMaintainer (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.util +
+Class ArchiveMaintainer

+
+java.lang.Object
+  extended by net.lingala.zip4j.util.ArchiveMaintainer
+
+
+
+
public class ArchiveMaintainer
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ArchiveMaintainer() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidinitProgressMonitorForMergeOp(ZipModel zipModel, + ProgressMonitor progressMonitor) + +
+           
+ voidinitProgressMonitorForRemoveOp(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ HashMapinitRemoveZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor) + +
+           
+ voidmergeSplitZipFiles(ZipModel zipModel, + File outputZipFile, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+          Merges split Zip files into a single Zip file
+ HashMapremoveZipFile(ZipModel zipModel, + FileHeader fileHeader, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidsetComment(ZipModel zipModel, + String comment) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ArchiveMaintainer

+
+public ArchiveMaintainer()
+
+
+ + + + + + + + +
+Method Detail
+ +

+removeZipFile

+
+public HashMap removeZipFile(ZipModel zipModel,
+                             FileHeader fileHeader,
+                             ProgressMonitor progressMonitor,
+                             boolean runInThread)
+                      throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+initRemoveZipFile

+
+public HashMap initRemoveZipFile(ZipModel zipModel,
+                                 FileHeader fileHeader,
+                                 ProgressMonitor progressMonitor)
+                          throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+mergeSplitZipFiles

+
+public void mergeSplitZipFiles(ZipModel zipModel,
+                               File outputZipFile,
+                               ProgressMonitor progressMonitor,
+                               boolean runInThread)
+                        throws ZipException
+
+
Merges split Zip files into a single Zip file +

+

+
Parameters:
zipModel - +
Throws: +
ZipException
+
+
+
+ +

+setComment

+
+public void setComment(ZipModel zipModel,
+                       String comment)
+                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+initProgressMonitorForRemoveOp

+
+public void initProgressMonitorForRemoveOp(ZipModel zipModel,
+                                           FileHeader fileHeader,
+                                           ProgressMonitor progressMonitor)
+                                    throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+initProgressMonitorForMergeOp

+
+public void initProgressMonitorForMergeOp(ZipModel zipModel,
+                                          ProgressMonitor progressMonitor)
+                                   throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/CRCUtil.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/CRCUtil.html new file mode 100644 index 00000000..0e1911d4 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/CRCUtil.html @@ -0,0 +1,283 @@ + + + + + + + +CRCUtil (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.util +
+Class CRCUtil

+
+java.lang.Object
+  extended by net.lingala.zip4j.util.CRCUtil
+
+
+
+
public class CRCUtil
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
CRCUtil() + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+static longcomputeFileCRC(String inputFile) + +
+           
+static longcomputeFileCRC(String inputFile, + ProgressMonitor progressMonitor) + +
+          Calculates CRC of a file
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+CRCUtil

+
+public CRCUtil()
+
+
+ + + + + + + + +
+Method Detail
+ +

+computeFileCRC

+
+public static long computeFileCRC(String inputFile)
+                           throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+computeFileCRC

+
+public static long computeFileCRC(String inputFile,
+                                  ProgressMonitor progressMonitor)
+                           throws ZipException
+
+
Calculates CRC of a file +

+

+
Parameters:
inputFile - - file for which crc has to be calculated +
Returns:
crc of the file +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/InternalZipConstants.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/InternalZipConstants.html new file mode 100644 index 00000000..41238517 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/InternalZipConstants.html @@ -0,0 +1,1735 @@ + + + + + + + +InternalZipConstants (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.util +
+Interface InternalZipConstants

+
+
+
public interface InternalZipConstants
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intAES_AUTH_LENGTH + +
+           
+static intAES_BLOCK_SIZE + +
+           
+static intAESSIG + +
+           
+static longARCEXTDATREC + +
+           
+static intBUFF_SIZE + +
+           
+static intCENATT + +
+           
+static intCENATX + +
+           
+static intCENCOM + +
+           
+static intCENCRC + +
+           
+static intCENDSK + +
+           
+static intCENEXT + +
+           
+static intCENFLG + +
+           
+static intCENHDR + +
+           
+static intCENHOW + +
+           
+static intCENLEN + +
+           
+static intCENNAM + +
+           
+static intCENOFF + +
+           
+static longCENSIG + +
+           
+static intCENSIZ + +
+           
+static intCENTIM + +
+           
+static intCENVEM + +
+           
+static intCENVER + +
+           
+static StringCHARSET_COMMENTS_DEFAULT + +
+           
+static StringCHARSET_CP850 + +
+           
+static StringCHARSET_DEFAULT + +
+           
+static StringCHARSET_UTF8 + +
+           
+static longDIGSIG + +
+           
+static intENDCOM + +
+           
+static intENDHDR + +
+           
+static intENDOFF + +
+           
+static longENDSIG + +
+           
+static intENDSIZ + +
+           
+static intENDSUB + +
+           
+static intENDTOT + +
+           
+static intEXTCRC + +
+           
+static intEXTHDR + +
+           
+static intEXTLEN + +
+           
+static intEXTRAFIELDZIP64LENGTH + +
+           
+static longEXTSIG + +
+           
+static intEXTSIZ + +
+           
+static intFILE_MODE_ARCHIVE + +
+           
+static intFILE_MODE_HIDDEN + +
+           
+static intFILE_MODE_HIDDEN_ARCHIVE + +
+           
+static intFILE_MODE_NONE + +
+           
+static intFILE_MODE_READ_ONLY + +
+           
+static intFILE_MODE_READ_ONLY_ARCHIVE + +
+           
+static intFILE_MODE_READ_ONLY_HIDDEN + +
+           
+static intFILE_MODE_READ_ONLY_HIDDEN_ARCHIVE + +
+           
+static intFILE_MODE_SYSTEM + +
+           
+static StringFILE_SEPARATOR + +
+           
+static intFOLDER_MODE_ARCHIVE + +
+           
+static intFOLDER_MODE_HIDDEN + +
+           
+static intFOLDER_MODE_HIDDEN_ARCHIVE + +
+           
+static intFOLDER_MODE_NONE + +
+           
+static intLIST_TYPE_FILE + +
+           
+static intLIST_TYPE_STRING + +
+           
+static intLOCCRC + +
+           
+static intLOCEXT + +
+           
+static intLOCFLG + +
+           
+static intLOCHDR + +
+           
+static intLOCHOW + +
+           
+static intLOCLEN + +
+           
+static intLOCNAM + +
+           
+static longLOCSIG + +
+           
+static intLOCSIZ + +
+           
+static intLOCTIM + +
+           
+static intLOCVER + +
+           
+static intMAX_ALLOWED_ZIP_COMMENT_LENGTH + +
+           
+static intMIN_SPLIT_LENGTH + +
+           
+static intMODE_UNZIP + +
+           
+static intMODE_ZIP + +
+           
+static StringOFFSET_CENTRAL_DIR + +
+           
+static StringREAD_MODE + +
+           
+static longSPLITSIG + +
+           
+static intSTD_DEC_HDR_SIZE + +
+           
+static StringTHREAD_NAME + +
+           
+static intUFT8_NAMES_FLAG + +
+           
+static intUPDATE_LFH_COMP_SIZE + +
+           
+static intUPDATE_LFH_CRC + +
+           
+static intUPDATE_LFH_UNCOMP_SIZE + +
+           
+static StringVERSION + +
+           
+static StringWRITE_MODE + +
+           
+static longZIP_64_LIMIT + +
+           
+static StringZIP_FILE_SEPARATOR + +
+           
+static longZIP64ENDCENDIRLOC + +
+           
+static longZIP64ENDCENDIRREC + +
+           
+  +

+ + + + + + + + +
+Field Detail
+ +

+LOCSIG

+
+static final long LOCSIG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+EXTSIG

+
+static final long EXTSIG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENSIG

+
+static final long CENSIG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENDSIG

+
+static final long ENDSIG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DIGSIG

+
+static final long DIGSIG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ARCEXTDATREC

+
+static final long ARCEXTDATREC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+SPLITSIG

+
+static final long SPLITSIG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ZIP64ENDCENDIRLOC

+
+static final long ZIP64ENDCENDIRLOC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ZIP64ENDCENDIRREC

+
+static final long ZIP64ENDCENDIRREC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+EXTRAFIELDZIP64LENGTH

+
+static final int EXTRAFIELDZIP64LENGTH
+
+
+
See Also:
Constant Field Values
+
+
+ +

+AESSIG

+
+static final int AESSIG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCHDR

+
+static final int LOCHDR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+EXTHDR

+
+static final int EXTHDR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENHDR

+
+static final int CENHDR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENDHDR

+
+static final int ENDHDR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCVER

+
+static final int LOCVER
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCFLG

+
+static final int LOCFLG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCHOW

+
+static final int LOCHOW
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCTIM

+
+static final int LOCTIM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCCRC

+
+static final int LOCCRC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCSIZ

+
+static final int LOCSIZ
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCLEN

+
+static final int LOCLEN
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCNAM

+
+static final int LOCNAM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LOCEXT

+
+static final int LOCEXT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+EXTCRC

+
+static final int EXTCRC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+EXTSIZ

+
+static final int EXTSIZ
+
+
+
See Also:
Constant Field Values
+
+
+ +

+EXTLEN

+
+static final int EXTLEN
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENVEM

+
+static final int CENVEM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENVER

+
+static final int CENVER
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENFLG

+
+static final int CENFLG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENHOW

+
+static final int CENHOW
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENTIM

+
+static final int CENTIM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENCRC

+
+static final int CENCRC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENSIZ

+
+static final int CENSIZ
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENLEN

+
+static final int CENLEN
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENNAM

+
+static final int CENNAM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENEXT

+
+static final int CENEXT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENCOM

+
+static final int CENCOM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENDSK

+
+static final int CENDSK
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENATT

+
+static final int CENATT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENATX

+
+static final int CENATX
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CENOFF

+
+static final int CENOFF
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENDSUB

+
+static final int ENDSUB
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENDTOT

+
+static final int ENDTOT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENDSIZ

+
+static final int ENDSIZ
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENDOFF

+
+static final int ENDOFF
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENDCOM

+
+static final int ENDCOM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+STD_DEC_HDR_SIZE

+
+static final int STD_DEC_HDR_SIZE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+AES_AUTH_LENGTH

+
+static final int AES_AUTH_LENGTH
+
+
+
See Also:
Constant Field Values
+
+
+ +

+AES_BLOCK_SIZE

+
+static final int AES_BLOCK_SIZE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+MIN_SPLIT_LENGTH

+
+static final int MIN_SPLIT_LENGTH
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ZIP_64_LIMIT

+
+static final long ZIP_64_LIMIT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+OFFSET_CENTRAL_DIR

+
+static final String OFFSET_CENTRAL_DIR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+VERSION

+
+static final String VERSION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+MODE_ZIP

+
+static final int MODE_ZIP
+
+
+
See Also:
Constant Field Values
+
+
+ +

+MODE_UNZIP

+
+static final int MODE_UNZIP
+
+
+
See Also:
Constant Field Values
+
+
+ +

+WRITE_MODE

+
+static final String WRITE_MODE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+READ_MODE

+
+static final String READ_MODE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+BUFF_SIZE

+
+static final int BUFF_SIZE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_NONE

+
+static final int FILE_MODE_NONE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_READ_ONLY

+
+static final int FILE_MODE_READ_ONLY
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_HIDDEN

+
+static final int FILE_MODE_HIDDEN
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_ARCHIVE

+
+static final int FILE_MODE_ARCHIVE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_READ_ONLY_HIDDEN

+
+static final int FILE_MODE_READ_ONLY_HIDDEN
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_READ_ONLY_ARCHIVE

+
+static final int FILE_MODE_READ_ONLY_ARCHIVE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_HIDDEN_ARCHIVE

+
+static final int FILE_MODE_HIDDEN_ARCHIVE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_READ_ONLY_HIDDEN_ARCHIVE

+
+static final int FILE_MODE_READ_ONLY_HIDDEN_ARCHIVE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FILE_MODE_SYSTEM

+
+static final int FILE_MODE_SYSTEM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FOLDER_MODE_NONE

+
+static final int FOLDER_MODE_NONE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FOLDER_MODE_HIDDEN

+
+static final int FOLDER_MODE_HIDDEN
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FOLDER_MODE_ARCHIVE

+
+static final int FOLDER_MODE_ARCHIVE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+FOLDER_MODE_HIDDEN_ARCHIVE

+
+static final int FOLDER_MODE_HIDDEN_ARCHIVE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+UPDATE_LFH_CRC

+
+static final int UPDATE_LFH_CRC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+UPDATE_LFH_COMP_SIZE

+
+static final int UPDATE_LFH_COMP_SIZE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+UPDATE_LFH_UNCOMP_SIZE

+
+static final int UPDATE_LFH_UNCOMP_SIZE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LIST_TYPE_FILE

+
+static final int LIST_TYPE_FILE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+LIST_TYPE_STRING

+
+static final int LIST_TYPE_STRING
+
+
+
See Also:
Constant Field Values
+
+
+ +

+UFT8_NAMES_FLAG

+
+static final int UFT8_NAMES_FLAG
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CHARSET_UTF8

+
+static final String CHARSET_UTF8
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CHARSET_CP850

+
+static final String CHARSET_CP850
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CHARSET_COMMENTS_DEFAULT

+
+static final String CHARSET_COMMENTS_DEFAULT
+
+
+
See Also:
Constant Field Values
+
+
+ +

+CHARSET_DEFAULT

+
+static final String CHARSET_DEFAULT
+
+
+
+
+
+ +

+FILE_SEPARATOR

+
+static final String FILE_SEPARATOR
+
+
+
+
+
+ +

+ZIP_FILE_SEPARATOR

+
+static final String ZIP_FILE_SEPARATOR
+
+
+
See Also:
Constant Field Values
+
+
+ +

+THREAD_NAME

+
+static final String THREAD_NAME
+
+
+
See Also:
Constant Field Values
+
+
+ +

+MAX_ALLOWED_ZIP_COMMENT_LENGTH

+
+static final int MAX_ALLOWED_ZIP_COMMENT_LENGTH
+
+
+
See Also:
Constant Field Values
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/Raw.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/Raw.html new file mode 100644 index 00000000..04960983 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/Raw.html @@ -0,0 +1,518 @@ + + + + + + + +Raw (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.util +
+Class Raw

+
+java.lang.Object
+  extended by net.lingala.zip4j.util.Raw
+
+
+
+
public class Raw
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
Raw() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static bytebitArrayToByte(int[] bitArray) + +
+           
+static byte[]convertCharArrayToByteArray(char[] charArray) + +
+          Converts a char array to byte array
+static voidprepareBuffAESIVBytes(byte[] buff, + int nonce, + int length) + +
+           
+static intreadIntLittleEndian(byte[] b, + int off) + +
+           
+static intreadLeInt(DataInput di, + byte[] b) + +
+           
+static longreadLongLittleEndian(byte[] array, + int pos) + +
+           
+static shortreadShortBigEndian(byte[] array, + int pos) + +
+           
+static intreadShortLittleEndian(byte[] b, + int off) + +
+           
+static byte[]toByteArray(int in) + +
+           
+static byte[]toByteArray(int in, + int outSize) + +
+           
+static voidwriteIntLittleEndian(byte[] array, + int pos, + int value) + +
+           
+static voidwriteLongLittleEndian(byte[] array, + int pos, + long value) + +
+           
+static voidwriteShortLittleEndian(byte[] array, + int pos, + short value) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Raw

+
+public Raw()
+
+
+ + + + + + + + +
+Method Detail
+ +

+readLongLittleEndian

+
+public static long readLongLittleEndian(byte[] array,
+                                        int pos)
+
+
+
+
+
+
+ +

+readLeInt

+
+public static int readLeInt(DataInput di,
+                            byte[] b)
+                     throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+readShortLittleEndian

+
+public static int readShortLittleEndian(byte[] b,
+                                        int off)
+
+
+
+
+
+
+ +

+readShortBigEndian

+
+public static final short readShortBigEndian(byte[] array,
+                                             int pos)
+
+
+
+
+
+
+ +

+readIntLittleEndian

+
+public static int readIntLittleEndian(byte[] b,
+                                      int off)
+
+
+
+
+
+
+ +

+toByteArray

+
+public static byte[] toByteArray(int in,
+                                 int outSize)
+
+
+
+
+
+
+ +

+toByteArray

+
+public static byte[] toByteArray(int in)
+
+
+
+
+
+
+ +

+writeShortLittleEndian

+
+public static final void writeShortLittleEndian(byte[] array,
+                                                int pos,
+                                                short value)
+
+
+
+
+
+
+ +

+writeIntLittleEndian

+
+public static final void writeIntLittleEndian(byte[] array,
+                                              int pos,
+                                              int value)
+
+
+
+
+
+
+ +

+writeLongLittleEndian

+
+public static void writeLongLittleEndian(byte[] array,
+                                         int pos,
+                                         long value)
+
+
+
+
+
+
+ +

+bitArrayToByte

+
+public static byte bitArrayToByte(int[] bitArray)
+                           throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+prepareBuffAESIVBytes

+
+public static void prepareBuffAESIVBytes(byte[] buff,
+                                         int nonce,
+                                         int length)
+
+
+
+
+
+
+ +

+convertCharArrayToByteArray

+
+public static byte[] convertCharArrayToByteArray(char[] charArray)
+
+
Converts a char array to byte array +

+

+
Parameters:
charArray - +
Returns:
byte array representation of the input char array
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/Zip4jConstants.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/Zip4jConstants.html new file mode 100644 index 00000000..10cd2149 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/Zip4jConstants.html @@ -0,0 +1,439 @@ + + + + + + + +Zip4jConstants (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.util +
+Interface Zip4jConstants

+
+
+
public interface Zip4jConstants
+ + +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intAES_STRENGTH_128 + +
+           
+static intAES_STRENGTH_192 + +
+           
+static intAES_STRENGTH_256 + +
+           
+static intCOMP_AES_ENC + +
+           
+static intCOMP_DEFLATE + +
+           
+static intCOMP_STORE + +
+           
+static intDEFLATE_LEVEL_FAST + +
+           
+static intDEFLATE_LEVEL_FASTEST + +
+           
+static intDEFLATE_LEVEL_MAXIMUM + +
+           
+static intDEFLATE_LEVEL_NORMAL + +
+           
+static intDEFLATE_LEVEL_ULTRA + +
+           
+static intENC_METHOD_AES + +
+           
+static intENC_METHOD_STANDARD + +
+           
+static intENC_NO_ENCRYPTION + +
+           
+  +

+ + + + + + + + +
+Field Detail
+ +

+COMP_STORE

+
+static final int COMP_STORE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+COMP_DEFLATE

+
+static final int COMP_DEFLATE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+COMP_AES_ENC

+
+static final int COMP_AES_ENC
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DEFLATE_LEVEL_FASTEST

+
+static final int DEFLATE_LEVEL_FASTEST
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DEFLATE_LEVEL_FAST

+
+static final int DEFLATE_LEVEL_FAST
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DEFLATE_LEVEL_NORMAL

+
+static final int DEFLATE_LEVEL_NORMAL
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DEFLATE_LEVEL_MAXIMUM

+
+static final int DEFLATE_LEVEL_MAXIMUM
+
+
+
See Also:
Constant Field Values
+
+
+ +

+DEFLATE_LEVEL_ULTRA

+
+static final int DEFLATE_LEVEL_ULTRA
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENC_NO_ENCRYPTION

+
+static final int ENC_NO_ENCRYPTION
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENC_METHOD_STANDARD

+
+static final int ENC_METHOD_STANDARD
+
+
+
See Also:
Constant Field Values
+
+
+ +

+ENC_METHOD_AES

+
+static final int ENC_METHOD_AES
+
+
+
See Also:
Constant Field Values
+
+
+ +

+AES_STRENGTH_128

+
+static final int AES_STRENGTH_128
+
+
+
See Also:
Constant Field Values
+
+
+ +

+AES_STRENGTH_192

+
+static final int AES_STRENGTH_192
+
+
+
See Also:
Constant Field Values
+
+
+ +

+AES_STRENGTH_256

+
+static final int AES_STRENGTH_256
+
+
+
See Also:
Constant Field Values
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/Zip4jUtil.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/Zip4jUtil.html new file mode 100644 index 00000000..d47c9325 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/Zip4jUtil.html @@ -0,0 +1,1020 @@ + + + + + + + +Zip4jUtil (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.util +
+Class Zip4jUtil

+
+java.lang.Object
+  extended by net.lingala.zip4j.util.Zip4jUtil
+
+
+
+
public class Zip4jUtil
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
Zip4jUtil() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static booleancheckArrayListTypes(ArrayList sourceList, + int type) + +
+          Checks to see if all the elements in the arraylist match the given type
+static booleancheckFileExists(File file) + +
+           
+static booleancheckFileExists(String path) + +
+           
+static booleancheckFileReadAccess(String path) + +
+           
+static booleancheckFileWriteAccess(String path) + +
+           
+static booleancheckOutputFolder(String path) + +
+           
+static byte[]convertCharset(String str) + +
+           
+static StringdecodeFileName(byte[] data, + boolean isUTF8) + +
+          Decodes file name based on encoding.
+static StringdetectCharSet(String str) + +
+          Detects the encoding charset for the input string
+static longdosToJavaTme(int dosTime) + +
+          Converts time in dos format to Java format
+static StringgetAbsoluteFilePath(String filePath) + +
+          Returns an absoulte path for the given file path
+static long[]getAllHeaderSignatures() + +
+           
+static StringgetCp850EncodedString(byte[] data) + +
+          Returns a string in Cp850 encoding from the input bytes.
+static intgetEncodedStringLength(String str) + +
+          returns the length of the string by wrapping it in a byte buffer with + the appropriate charset of the input string and returns the limit of the + byte buffer
+static intgetEncodedStringLength(String str, + String charset) + +
+          returns the length of the string in the input encoding
+static FileHeadergetFileHeader(ZipModel zipModel, + String fileName) + +
+           
+static FileHeadergetFileHeaderWithExactMatch(ZipModel zipModel, + String fileName) + +
+           
+static longgetFileLengh(File file) + +
+           
+static longgetFileLengh(String file) + +
+           
+static StringgetFileNameFromFilePath(File file) + +
+           
+static ArrayListgetFilesInDirectoryRec(File path, + boolean readHiddenFiles) + +
+           
+static intgetIndexOfFileHeader(ZipModel zipModel, + FileHeader fileHeader) + +
+           
+static longgetLastModifiedFileTime(File file, + TimeZone timeZone) + +
+           
+static StringgetRelativeFileName(String file, + String rootFolderInZip, + String rootFolderPath) + +
+           
+static ArrayListgetSplitZipFiles(ZipModel zipModel) + +
+           
+static StringgetZipFileNameWithoutExt(String zipFile) + +
+           
+static booleanisStringNotNullAndNotEmpty(String str) + +
+           
+static booleanisSupportedCharset(String charset) + +
+          Checks if the input charset is supported
+static booleanisWindows() + +
+           
+static longjavaToDosTime(long time) + +
+          Converts input time from Java to DOS format
+static voidsetFileArchive(File file) + +
+           
+static voidsetFileHidden(File file) + +
+           
+static voidsetFileReadOnly(File file) + +
+           
+static voidsetFileSystemMode(File file) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Zip4jUtil

+
+public Zip4jUtil()
+
+
+ + + + + + + + +
+Method Detail
+ +

+isStringNotNullAndNotEmpty

+
+public static boolean isStringNotNullAndNotEmpty(String str)
+
+
+
+
+
+
+ +

+checkOutputFolder

+
+public static boolean checkOutputFolder(String path)
+                                 throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+checkFileReadAccess

+
+public static boolean checkFileReadAccess(String path)
+                                   throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+checkFileWriteAccess

+
+public static boolean checkFileWriteAccess(String path)
+                                    throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+checkFileExists

+
+public static boolean checkFileExists(String path)
+                               throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+checkFileExists

+
+public static boolean checkFileExists(File file)
+                               throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+isWindows

+
+public static boolean isWindows()
+
+
+
+
+
+
+ +

+setFileReadOnly

+
+public static void setFileReadOnly(File file)
+                            throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+setFileHidden

+
+public static void setFileHidden(File file)
+                          throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+setFileArchive

+
+public static void setFileArchive(File file)
+                           throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+setFileSystemMode

+
+public static void setFileSystemMode(File file)
+                              throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getLastModifiedFileTime

+
+public static long getLastModifiedFileTime(File file,
+                                           TimeZone timeZone)
+                                    throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getFileNameFromFilePath

+
+public static String getFileNameFromFilePath(File file)
+                                      throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getFileLengh

+
+public static long getFileLengh(String file)
+                         throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getFileLengh

+
+public static long getFileLengh(File file)
+                         throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+javaToDosTime

+
+public static long javaToDosTime(long time)
+
+
Converts input time from Java to DOS format +

+

+
Parameters:
time - +
Returns:
time in DOS format
+
+
+
+ +

+dosToJavaTme

+
+public static long dosToJavaTme(int dosTime)
+
+
Converts time in dos format to Java format +

+

+
Parameters:
dosTime - +
Returns:
time in java format
+
+
+
+ +

+getFileHeader

+
+public static FileHeader getFileHeader(ZipModel zipModel,
+                                       String fileName)
+                                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getFileHeaderWithExactMatch

+
+public static FileHeader getFileHeaderWithExactMatch(ZipModel zipModel,
+                                                     String fileName)
+                                              throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getIndexOfFileHeader

+
+public static int getIndexOfFileHeader(ZipModel zipModel,
+                                       FileHeader fileHeader)
+                                throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getFilesInDirectoryRec

+
+public static ArrayList getFilesInDirectoryRec(File path,
+                                               boolean readHiddenFiles)
+                                        throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getZipFileNameWithoutExt

+
+public static String getZipFileNameWithoutExt(String zipFile)
+                                       throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+convertCharset

+
+public static byte[] convertCharset(String str)
+                             throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+decodeFileName

+
+public static String decodeFileName(byte[] data,
+                                    boolean isUTF8)
+
+
Decodes file name based on encoding. If file name is UTF 8 encoded + returns an UTF8 encoded string, else return Cp850 encoded String. If + appropriate charset is not supported, then returns a System default + charset encoded String +

+

+
Parameters:
data -
isUTF8 - +
Returns:
String
+
+
+
+ +

+getCp850EncodedString

+
+public static String getCp850EncodedString(byte[] data)
+
+
Returns a string in Cp850 encoding from the input bytes. + If this encoding is not supported, then String with the default encoding is returned. +

+

+
Parameters:
data - +
Returns:
String
+
+
+
+ +

+getAbsoluteFilePath

+
+public static String getAbsoluteFilePath(String filePath)
+                                  throws ZipException
+
+
Returns an absoulte path for the given file path +

+

+
Parameters:
filePath - +
Returns:
String +
Throws: +
ZipException
+
+
+
+ +

+checkArrayListTypes

+
+public static boolean checkArrayListTypes(ArrayList sourceList,
+                                          int type)
+                                   throws ZipException
+
+
Checks to see if all the elements in the arraylist match the given type +

+

+
Parameters:
sourceList - - list to be checked
type - - type of elements to be present in the list (ex: File, String, etc) +
Returns:
true if all elements match the given type, if not returns false +
Throws: +
ZipException
+
+
+
+ +

+detectCharSet

+
+public static String detectCharSet(String str)
+                            throws ZipException
+
+
Detects the encoding charset for the input string +

+

+
Parameters:
str - +
Returns:
String - charset for the String +
Throws: +
ZipException - - if input string is null. In case of any other exception + this method returns default System charset
+
+
+
+ +

+getEncodedStringLength

+
+public static int getEncodedStringLength(String str)
+                                  throws ZipException
+
+
returns the length of the string by wrapping it in a byte buffer with + the appropriate charset of the input string and returns the limit of the + byte buffer +

+

+
Parameters:
str - +
Returns:
length of the string +
Throws: +
ZipException
+
+
+
+ +

+getEncodedStringLength

+
+public static int getEncodedStringLength(String str,
+                                         String charset)
+                                  throws ZipException
+
+
returns the length of the string in the input encoding +

+

+
Parameters:
str -
charset - +
Returns:
int +
Throws: +
ZipException
+
+
+
+ +

+isSupportedCharset

+
+public static boolean isSupportedCharset(String charset)
+                                  throws ZipException
+
+
Checks if the input charset is supported +

+

+
Parameters:
charset - +
Returns:
boolean +
Throws: +
ZipException
+
+
+
+ +

+getSplitZipFiles

+
+public static ArrayList getSplitZipFiles(ZipModel zipModel)
+                                  throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getRelativeFileName

+
+public static String getRelativeFileName(String file,
+                                         String rootFolderInZip,
+                                         String rootFolderPath)
+                                  throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+getAllHeaderSignatures

+
+public static long[] getAllHeaderSignatures()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/ArchiveMaintainer.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/ArchiveMaintainer.html new file mode 100644 index 00000000..1468b3ec --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/ArchiveMaintainer.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.util.ArchiveMaintainer (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.util.ArchiveMaintainer

+
+No usage of net.lingala.zip4j.util.ArchiveMaintainer +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/CRCUtil.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/CRCUtil.html new file mode 100644 index 00000000..48f36a17 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/CRCUtil.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.util.CRCUtil (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.util.CRCUtil

+
+No usage of net.lingala.zip4j.util.CRCUtil +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/InternalZipConstants.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/InternalZipConstants.html new file mode 100644 index 00000000..0d20fa89 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/InternalZipConstants.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Interface net.lingala.zip4j.util.InternalZipConstants (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
net.lingala.zip4j.util.InternalZipConstants

+
+No usage of net.lingala.zip4j.util.InternalZipConstants +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Raw.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Raw.html new file mode 100644 index 00000000..b8e8fada --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Raw.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.util.Raw (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.util.Raw

+
+No usage of net.lingala.zip4j.util.Raw +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Zip4jConstants.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Zip4jConstants.html new file mode 100644 index 00000000..22e0e72a --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Zip4jConstants.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Interface net.lingala.zip4j.util.Zip4jConstants (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
net.lingala.zip4j.util.Zip4jConstants

+
+No usage of net.lingala.zip4j.util.Zip4jConstants +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Zip4jUtil.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Zip4jUtil.html new file mode 100644 index 00000000..414ccba7 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/class-use/Zip4jUtil.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.util.Zip4jUtil (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.util.Zip4jUtil

+
+No usage of net.lingala.zip4j.util.Zip4jUtil +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-frame.html new file mode 100644 index 00000000..1812347e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-frame.html @@ -0,0 +1,52 @@ + + + + + + + +net.lingala.zip4j.util (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.util + + + + +
+Interfaces  + +
+InternalZipConstants +
+Zip4jConstants
+ + + + + + +
+Classes  + +
+ArchiveMaintainer +
+CRCUtil +
+Raw +
+Zip4jUtil
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-summary.html new file mode 100644 index 00000000..3a52826c --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-summary.html @@ -0,0 +1,188 @@ + + + + + + + +net.lingala.zip4j.util (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.util +

+ + + + + + + + + + + + + +
+Interface Summary
InternalZipConstants 
Zip4jConstants 
+  + +

+ + + + + + + + + + + + + + + + + + + + + +
+Class Summary
ArchiveMaintainer 
CRCUtil 
Raw 
Zip4jUtil 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-tree.html new file mode 100644 index 00000000..ad393189 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-tree.html @@ -0,0 +1,159 @@ + + + + + + + +net.lingala.zip4j.util Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.util +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/util/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-use.html new file mode 100644 index 00000000..1862a718 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/util/package-use.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Package net.lingala.zip4j.util (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.util

+
+No usage of net.lingala.zip4j.util +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/zip/ZipEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/zip/ZipEngine.html new file mode 100644 index 00000000..89d585de --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/zip/ZipEngine.html @@ -0,0 +1,319 @@ + + + + + + + +ZipEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +net.lingala.zip4j.zip +
+Class ZipEngine

+
+java.lang.Object
+  extended by net.lingala.zip4j.zip.ZipEngine
+
+
+
+
public class ZipEngine
extends Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
ZipEngine(ZipModel zipModel) + +
+           
+  + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddFiles(ArrayList fileList, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidaddFolderToZip(File file, + ZipParameters parameters, + ProgressMonitor progressMonitor, + boolean runInThread) + +
+           
+ voidaddStreamToZip(InputStream inputStream, + ZipParameters parameters) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ZipEngine

+
+public ZipEngine(ZipModel zipModel)
+          throws ZipException
+
+
+ +
Throws: +
ZipException
+
+ + + + + + + + +
+Method Detail
+ +

+addFiles

+
+public void addFiles(ArrayList fileList,
+                     ZipParameters parameters,
+                     ProgressMonitor progressMonitor,
+                     boolean runInThread)
+              throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+addStreamToZip

+
+public void addStreamToZip(InputStream inputStream,
+                           ZipParameters parameters)
+                    throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+
+ +

+addFolderToZip

+
+public void addFolderToZip(File file,
+                           ZipParameters parameters,
+                           ProgressMonitor progressMonitor,
+                           boolean runInThread)
+                    throws ZipException
+
+
+ +
Throws: +
ZipException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/zip/class-use/ZipEngine.html b/lib/zip4j/javadoc/net/lingala/zip4j/zip/class-use/ZipEngine.html new file mode 100644 index 00000000..974453f9 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/zip/class-use/ZipEngine.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Class net.lingala.zip4j.zip.ZipEngine (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
net.lingala.zip4j.zip.ZipEngine

+
+No usage of net.lingala.zip4j.zip.ZipEngine +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-frame.html b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-frame.html new file mode 100644 index 00000000..dcb81cb3 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-frame.html @@ -0,0 +1,33 @@ + + + + + + + +net.lingala.zip4j.zip (zip4j 1.3.1 API) + + + + + + + + + + + +net.lingala.zip4j.zip + + + + +
+Classes  + +
+ZipEngine
+ + + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-summary.html b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-summary.html new file mode 100644 index 00000000..9c5a9d48 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-summary.html @@ -0,0 +1,158 @@ + + + + + + + +net.lingala.zip4j.zip (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package net.lingala.zip4j.zip +

+ + + + + + + + + +
+Class Summary
ZipEngine 
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-tree.html b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-tree.html new file mode 100644 index 00000000..1c567d5e --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-tree.html @@ -0,0 +1,154 @@ + + + + + + + +net.lingala.zip4j.zip Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package net.lingala.zip4j.zip +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-use.html b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-use.html new file mode 100644 index 00000000..74cc77f2 --- /dev/null +++ b/lib/zip4j/javadoc/net/lingala/zip4j/zip/package-use.html @@ -0,0 +1,145 @@ + + + + + + + +Uses of Package net.lingala.zip4j.zip (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
net.lingala.zip4j.zip

+
+No usage of net.lingala.zip4j.zip +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/overview-frame.html b/lib/zip4j/javadoc/overview-frame.html new file mode 100644 index 00000000..fa7f6354 --- /dev/null +++ b/lib/zip4j/javadoc/overview-frame.html @@ -0,0 +1,63 @@ + + + + + + + +Overview List (zip4j 1.3.1 API) + + + + + + + + + + + + + + + +
+
+ + + + + +
All Classes +

+ +Packages +
+net.lingala.zip4j.core +
+net.lingala.zip4j.crypto +
+net.lingala.zip4j.crypto.engine +
+net.lingala.zip4j.crypto.PBKDF2 +
+net.lingala.zip4j.exception +
+net.lingala.zip4j.io +
+net.lingala.zip4j.model +
+net.lingala.zip4j.progress +
+net.lingala.zip4j.unzip +
+net.lingala.zip4j.util +
+net.lingala.zip4j.zip +
+

+ +

+  + + diff --git a/lib/zip4j/javadoc/overview-summary.html b/lib/zip4j/javadoc/overview-summary.html new file mode 100644 index 00000000..b990c24e --- /dev/null +++ b/lib/zip4j/javadoc/overview-summary.html @@ -0,0 +1,197 @@ + + + + + + + +Overview (zip4j 1.3.1 API) + + + + + + + + + + + + +


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+zip4j 1.3.1 API +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages
net.lingala.zip4j.core 
net.lingala.zip4j.crypto 
net.lingala.zip4j.crypto.engine 
net.lingala.zip4j.crypto.PBKDF2 
net.lingala.zip4j.exception 
net.lingala.zip4j.io 
net.lingala.zip4j.model 
net.lingala.zip4j.progress 
net.lingala.zip4j.unzip 
net.lingala.zip4j.util 
net.lingala.zip4j.zip 
+ +


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/overview-tree.html b/lib/zip4j/javadoc/overview-tree.html new file mode 100644 index 00000000..2458b583 --- /dev/null +++ b/lib/zip4j/javadoc/overview-tree.html @@ -0,0 +1,185 @@ + + + + + + + +Class Hierarchy (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
net.lingala.zip4j.core, net.lingala.zip4j.crypto, net.lingala.zip4j.crypto.engine, net.lingala.zip4j.crypto.PBKDF2, net.lingala.zip4j.exception, net.lingala.zip4j.io, net.lingala.zip4j.model, net.lingala.zip4j.progress, net.lingala.zip4j.unzip, net.lingala.zip4j.util, net.lingala.zip4j.zip
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/package-list b/lib/zip4j/javadoc/package-list new file mode 100644 index 00000000..929080f2 --- /dev/null +++ b/lib/zip4j/javadoc/package-list @@ -0,0 +1,11 @@ +net.lingala.zip4j.core +net.lingala.zip4j.crypto +net.lingala.zip4j.crypto.PBKDF2 +net.lingala.zip4j.crypto.engine +net.lingala.zip4j.exception +net.lingala.zip4j.io +net.lingala.zip4j.model +net.lingala.zip4j.progress +net.lingala.zip4j.unzip +net.lingala.zip4j.util +net.lingala.zip4j.zip diff --git a/lib/zip4j/javadoc/resources/inherit.gif b/lib/zip4j/javadoc/resources/inherit.gif new file mode 100644 index 00000000..c814867a Binary files /dev/null and b/lib/zip4j/javadoc/resources/inherit.gif differ diff --git a/lib/zip4j/javadoc/serialized-form.html b/lib/zip4j/javadoc/serialized-form.html new file mode 100644 index 00000000..9930bb9f --- /dev/null +++ b/lib/zip4j/javadoc/serialized-form.html @@ -0,0 +1,183 @@ + + + + + + + +Serialized Form (zip4j 1.3.1 API) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Serialized Form

+
+
+ + + + + +
+Package net.lingala.zip4j.exception
+ +

+ + + + + +
+Class net.lingala.zip4j.exception.ZipException extends Exception implements Serializable
+ +

+serialVersionUID: 1L + +

+ + + + + +
+Serialized Fields
+ +

+code

+
+int code
+
+
+
+
+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+Copyright © 2012. All Rights Reserved. + + diff --git a/lib/zip4j/javadoc/stylesheet.css b/lib/zip4j/javadoc/stylesheet.css new file mode 100644 index 00000000..6ea9e516 --- /dev/null +++ b/lib/zip4j/javadoc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF; color:#000000 } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ +.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} + diff --git a/lib/zip4j/src/net/lingala/zip4j/core/HeaderReader.java b/lib/zip4j/src/net/lingala/zip4j/core/HeaderReader.java new file mode 100644 index 00000000..3f0285f2 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/core/HeaderReader.java @@ -0,0 +1,1119 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.core; + +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.ArrayList; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.exception.ZipExceptionConstants; +import net.lingala.zip4j.model.AESExtraDataRecord; +import net.lingala.zip4j.model.CentralDirectory; +import net.lingala.zip4j.model.DigitalSignature; +import net.lingala.zip4j.model.EndCentralDirRecord; +import net.lingala.zip4j.model.ExtraDataRecord; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.LocalFileHeader; +import net.lingala.zip4j.model.Zip64EndCentralDirLocator; +import net.lingala.zip4j.model.Zip64EndCentralDirRecord; +import net.lingala.zip4j.model.Zip64ExtendedInfo; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Raw; +import net.lingala.zip4j.util.Zip4jConstants; +import net.lingala.zip4j.util.Zip4jUtil; + +/** + * Helper class to read header information for the zip file + * + */ +public class HeaderReader { + + private RandomAccessFile zip4jRaf = null; + private ZipModel zipModel; + + /** + * Creates a new HeaderReader object with the given input stream + * @param zip4jRaf + */ + public HeaderReader(RandomAccessFile zip4jRaf) { + this.zip4jRaf = zip4jRaf; + } + + /** + * Reads all the header information for the zip file. + *

Note: This method does not read local file header information + * @return {@link ZipModel} + * @throws ZipException + */ + public ZipModel readAllHeaders() throws ZipException { + return readAllHeaders(null); + } + + /** + * Reads all the header information for the zip file. File names are read with + * input charset name. If this parameter is null, default system charset is used. + *

Note: This method does not read local file header information + * @return {@link ZipModel} + * @throws ZipException + */ + public ZipModel readAllHeaders(String fileNameCharset) throws ZipException { + zipModel = new ZipModel(); + zipModel.setFileNameCharset(fileNameCharset); + zipModel.setEndCentralDirRecord(readEndOfCentralDirectoryRecord()); + + // If file is Zip64 format, then Zip64 headers have to be read before + // reading central directory + zipModel.setZip64EndCentralDirLocator(readZip64EndCentralDirLocator()); + + if (zipModel.isZip64Format()) { + zipModel.setZip64EndCentralDirRecord(readZip64EndCentralDirRec()); + if(zipModel.getZip64EndCentralDirRecord() != null && + zipModel.getZip64EndCentralDirRecord().getNoOfThisDisk() > 0){ + zipModel.setSplitArchive(true); + } else { + zipModel.setSplitArchive(false); + } + } + + zipModel.setCentralDirectory(readCentralDirectory()); + //zipModel.setLocalFileHeaderList(readLocalFileHeaders()); //Donot read local headers now. + return zipModel; + } + + /** + * Reads end of central directory record + * @return {@link EndCentralDirRecord} + * @throws ZipException + */ + private EndCentralDirRecord readEndOfCentralDirectoryRecord() throws ZipException { + + if (zip4jRaf == null) { + throw new ZipException("random access file was null", ZipExceptionConstants.randomAccessFileNull); + } + + try { + byte[] ebs = new byte[4]; + long pos = zip4jRaf.length() - InternalZipConstants.ENDHDR; + + EndCentralDirRecord endCentralDirRecord = new EndCentralDirRecord(); + int counter = 0; + do { + zip4jRaf.seek(pos--); + counter++; + } while ((Raw.readLeInt(zip4jRaf, ebs) != InternalZipConstants.ENDSIG) && counter <= 3000); + + if ((Raw.readIntLittleEndian(ebs, 0) != InternalZipConstants.ENDSIG)) { + throw new ZipException("zip headers not found. probably not a zip file"); + } + byte[] intBuff = new byte[4]; + byte[] shortBuff = new byte[2]; + + //End of central record signature + endCentralDirRecord.setSignature(InternalZipConstants.ENDSIG); + + //number of this disk + readIntoBuff(zip4jRaf, shortBuff); + endCentralDirRecord.setNoOfThisDisk(Raw.readShortLittleEndian(shortBuff, 0)); + + //number of the disk with the start of the central directory + readIntoBuff(zip4jRaf, shortBuff); + endCentralDirRecord.setNoOfThisDiskStartOfCentralDir(Raw.readShortLittleEndian(shortBuff, 0)); + + //total number of entries in the central directory on this disk + readIntoBuff(zip4jRaf, shortBuff); + endCentralDirRecord.setTotNoOfEntriesInCentralDirOnThisDisk(Raw.readShortLittleEndian(shortBuff, 0)); + + //total number of entries in the central directory + readIntoBuff(zip4jRaf, shortBuff); + endCentralDirRecord.setTotNoOfEntriesInCentralDir(Raw.readShortLittleEndian(shortBuff, 0)); + + //size of the central directory + readIntoBuff(zip4jRaf, intBuff); + endCentralDirRecord.setSizeOfCentralDir(Raw.readIntLittleEndian(intBuff, 0)); + + //offset of start of central directory with respect to the starting disk number + readIntoBuff(zip4jRaf, intBuff); + byte[] longBuff = getLongByteFromIntByte(intBuff); + endCentralDirRecord.setOffsetOfStartOfCentralDir(Raw.readLongLittleEndian(longBuff, 0)); + + //.ZIP file comment length + readIntoBuff(zip4jRaf, shortBuff); + int commentLength = Raw.readShortLittleEndian(shortBuff, 0); + endCentralDirRecord.setCommentLength(commentLength); + + //.ZIP file comment + if (commentLength > 0) { + byte[] commentBuf = new byte[commentLength]; + readIntoBuff(zip4jRaf, commentBuf); + endCentralDirRecord.setComment(new String(commentBuf)); + endCentralDirRecord.setCommentBytes(commentBuf); + } else { + endCentralDirRecord.setComment(null); + } + + int diskNumber = endCentralDirRecord.getNoOfThisDisk(); + if (diskNumber > 0) { + zipModel.setSplitArchive(true); + } else { + zipModel.setSplitArchive(false); + } + + return endCentralDirRecord; + } catch (IOException e) { + throw new ZipException("Probably not a zip file or a corrupted zip file", e, ZipExceptionConstants.notZipFile); + } + } + + /** + * Reads central directory information for the zip file + * @return {@link CentralDirectory} + * @throws ZipException + */ + private CentralDirectory readCentralDirectory() throws ZipException { + + if (zip4jRaf == null) { + throw new ZipException("random access file was null", ZipExceptionConstants.randomAccessFileNull); + } + + if (zipModel.getEndCentralDirRecord() == null) { + throw new ZipException("EndCentralRecord was null, maybe a corrupt zip file"); + } + + try { + CentralDirectory centralDirectory = new CentralDirectory(); + ArrayList fileHeaderList = new ArrayList(); + + EndCentralDirRecord endCentralDirRecord = zipModel.getEndCentralDirRecord(); + long offSetStartCentralDir = endCentralDirRecord.getOffsetOfStartOfCentralDir(); + int centralDirEntryCount = endCentralDirRecord.getTotNoOfEntriesInCentralDir(); + + if (zipModel.isZip64Format()) { + offSetStartCentralDir = zipModel.getZip64EndCentralDirRecord().getOffsetStartCenDirWRTStartDiskNo(); + centralDirEntryCount = (int)zipModel.getZip64EndCentralDirRecord().getTotNoOfEntriesInCentralDir(); + } + + zip4jRaf.seek(offSetStartCentralDir); + + byte[] intBuff = new byte[4]; + byte[] shortBuff = new byte[2]; + byte[] longBuff = new byte[8]; + + for (int i = 0; i < centralDirEntryCount; i++) { + FileHeader fileHeader = new FileHeader(); + + //FileHeader Signature + readIntoBuff(zip4jRaf, intBuff); + int signature = Raw.readIntLittleEndian(intBuff, 0); + if (signature != InternalZipConstants.CENSIG) { + throw new ZipException("Expected central directory entry not found (#" + (i + 1) + ")"); + } + fileHeader.setSignature(signature); + + //version made by + readIntoBuff(zip4jRaf, shortBuff); + fileHeader.setVersionMadeBy(Raw.readShortLittleEndian(shortBuff, 0)); + + //version needed to extract + readIntoBuff(zip4jRaf, shortBuff); + fileHeader.setVersionNeededToExtract(Raw.readShortLittleEndian(shortBuff, 0)); + + //general purpose bit flag + readIntoBuff(zip4jRaf, shortBuff); + fileHeader.setFileNameUTF8Encoded((Raw.readShortLittleEndian(shortBuff, 0) & InternalZipConstants.UFT8_NAMES_FLAG) != 0); + int firstByte = shortBuff[0]; + int result = firstByte & 1; + if (result != 0) { + fileHeader.setEncrypted(true); + } + fileHeader.setGeneralPurposeFlag((byte[])shortBuff.clone()); + + //Check if data descriptor exists for local file header + fileHeader.setDataDescriptorExists(firstByte>>3 == 1); + + //compression method + readIntoBuff(zip4jRaf, shortBuff); + fileHeader.setCompressionMethod(Raw.readShortLittleEndian(shortBuff, 0)); + + //last mod file time + readIntoBuff(zip4jRaf, intBuff); + fileHeader.setLastModFileTime(Raw.readIntLittleEndian(intBuff, 0)); + + //crc-32 + readIntoBuff(zip4jRaf, intBuff); + fileHeader.setCrc32(Raw.readIntLittleEndian(intBuff, 0)); + fileHeader.setCrcBuff((byte[])intBuff.clone()); + + //compressed size + readIntoBuff(zip4jRaf, intBuff); + longBuff = getLongByteFromIntByte(intBuff); + fileHeader.setCompressedSize(Raw.readLongLittleEndian(longBuff, 0)); + + //uncompressed size + readIntoBuff(zip4jRaf, intBuff); + longBuff = getLongByteFromIntByte(intBuff); + fileHeader.setUncompressedSize(Raw.readLongLittleEndian(longBuff, 0)); + + //file name length + readIntoBuff(zip4jRaf, shortBuff); + int fileNameLength = Raw.readShortLittleEndian(shortBuff, 0); + fileHeader.setFileNameLength(fileNameLength); + + //extra field length + readIntoBuff(zip4jRaf, shortBuff); + int extraFieldLength = Raw.readShortLittleEndian(shortBuff, 0); + fileHeader.setExtraFieldLength(extraFieldLength); + + //file comment length + readIntoBuff(zip4jRaf, shortBuff); + int fileCommentLength = Raw.readShortLittleEndian(shortBuff, 0); + fileHeader.setFileComment(new String(shortBuff)); + + //disk number start + readIntoBuff(zip4jRaf, shortBuff); + fileHeader.setDiskNumberStart(Raw.readShortLittleEndian(shortBuff, 0)); + + //internal file attributes + readIntoBuff(zip4jRaf, shortBuff); + fileHeader.setInternalFileAttr((byte[])shortBuff.clone()); + + //external file attributes + readIntoBuff(zip4jRaf, intBuff); + fileHeader.setExternalFileAttr((byte[])intBuff.clone()); + + //relative offset of local header + readIntoBuff(zip4jRaf, intBuff); + //Commented on 26.08.2010. Revert back if any issues + //fileHeader.setOffsetLocalHeader((Raw.readIntLittleEndian(intBuff, 0) & 0xFFFFFFFFL) + zip4jRaf.getStart()); + longBuff = getLongByteFromIntByte(intBuff); + fileHeader.setOffsetLocalHeader((Raw.readLongLittleEndian(longBuff, 0) & 0xFFFFFFFFL)); + + if (fileNameLength > 0) { + byte[] fileNameBuf = new byte[fileNameLength]; + readIntoBuff(zip4jRaf, fileNameBuf); + // Modified after user reported an issue http://www.lingala.net/zip4j/forum/index.php?topic=2.0 +// String fileName = new String(fileNameBuf, "Cp850"); + // Modified as per http://www.lingala.net/zip4j/forum/index.php?topic=41.0 +// String fileName = Zip4jUtil.getCp850EncodedString(fileNameBuf); + + String fileName = null; + + if (Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getFileNameCharset())) { + fileName = new String(fileNameBuf, zipModel.getFileNameCharset()); + } else { + fileName = Zip4jUtil.decodeFileName(fileNameBuf, fileHeader.isFileNameUTF8Encoded()); + } + + if (fileName == null) { + throw new ZipException("fileName is null when reading central directory"); + } + + if (fileName.indexOf(":" + System.getProperty("file.separator")) >= 0) { + fileName = fileName.substring(fileName.indexOf(":" + System.getProperty("file.separator")) + 2); + } + + fileHeader.setFileName(fileName); + fileHeader.setDirectory(fileName.endsWith("/") || fileName.endsWith("\\")); + + } else { + fileHeader.setFileName(null); + } + + //Extra field + readAndSaveExtraDataRecord(fileHeader); + + //Read Zip64 Extra data records if exists + readAndSaveZip64ExtendedInfo(fileHeader); + + //Read AES Extra Data record if exists + readAndSaveAESExtraDataRecord(fileHeader); + +// if (fileHeader.isEncrypted()) { +// +// if (fileHeader.getEncryptionMethod() == ZipConstants.ENC_METHOD_AES) { +// //Do nothing +// } else { +// if ((firstByte & 64) == 64) { +// //hardcoded for now +// fileHeader.setEncryptionMethod(1); +// } else { +// fileHeader.setEncryptionMethod(ZipConstants.ENC_METHOD_STANDARD); +// fileHeader.setCompressedSize(fileHeader.getCompressedSize() +// - ZipConstants.STD_DEC_HDR_SIZE); +// } +// } +// +// } + + if (fileCommentLength > 0) { + byte[] fileCommentBuf = new byte[fileCommentLength]; + readIntoBuff(zip4jRaf, fileCommentBuf); + fileHeader.setFileComment(new String(fileCommentBuf)); + } + + fileHeaderList.add(fileHeader); + } + centralDirectory.setFileHeaders(fileHeaderList); + + //Digital Signature + DigitalSignature digitalSignature = new DigitalSignature(); + readIntoBuff(zip4jRaf, intBuff); + int signature = Raw.readIntLittleEndian(intBuff, 0); + if (signature != InternalZipConstants.DIGSIG) { + return centralDirectory; + } + + digitalSignature.setHeaderSignature(signature); + + //size of data + readIntoBuff(zip4jRaf, shortBuff); + int sizeOfData = Raw.readShortLittleEndian(shortBuff, 0); + digitalSignature.setSizeOfData(sizeOfData); + + if (sizeOfData > 0) { + byte[] sigDataBuf = new byte[sizeOfData]; + readIntoBuff(zip4jRaf, sigDataBuf); + digitalSignature.setSignatureData(new String(sigDataBuf)); + } + + return centralDirectory; + } catch (IOException e) { + throw new ZipException(e); + } + } + + /** + * Reads extra data record and saves it in the {@link FileHeader} + * @param fileHeader + * @throws ZipException + */ + private void readAndSaveExtraDataRecord(FileHeader fileHeader) throws ZipException { + + if (zip4jRaf == null) { + throw new ZipException("invalid file handler when trying to read extra data record"); + } + + if (fileHeader == null) { + throw new ZipException("file header is null"); + } + + int extraFieldLength = fileHeader.getExtraFieldLength(); + if (extraFieldLength <= 0) { + return; + } + + fileHeader.setExtraDataRecords(readExtraDataRecords(extraFieldLength)); + + } + + /** + * Reads extra data record and saves it in the {@link LocalFileHeader} + * @param localFileHeader + * @throws ZipException + */ + private void readAndSaveExtraDataRecord(LocalFileHeader localFileHeader) throws ZipException { + + if (zip4jRaf == null) { + throw new ZipException("invalid file handler when trying to read extra data record"); + } + + if (localFileHeader == null) { + throw new ZipException("file header is null"); + } + + int extraFieldLength = localFileHeader.getExtraFieldLength(); + if (extraFieldLength <= 0) { + return; + } + + localFileHeader.setExtraDataRecords(readExtraDataRecords(extraFieldLength)); + + } + + /** + * Reads extra data records + * @param extraFieldLength + * @return ArrayList of {@link ExtraDataRecord} + * @throws ZipException + */ + private ArrayList readExtraDataRecords(int extraFieldLength) throws ZipException { + + if (extraFieldLength <= 0) { + return null; + } + + try { + byte[] extraFieldBuf = new byte[extraFieldLength]; + zip4jRaf.read(extraFieldBuf); + + int counter = 0; + ArrayList extraDataList = new ArrayList(); + while(counter < extraFieldLength) { + ExtraDataRecord extraDataRecord = new ExtraDataRecord(); + int header = Raw.readShortLittleEndian(extraFieldBuf, counter); + extraDataRecord.setHeader(header); + counter = counter + 2; + int sizeOfRec = Raw.readShortLittleEndian(extraFieldBuf, counter); + + if ((2 + sizeOfRec) > extraFieldLength) { + sizeOfRec = Raw.readShortBigEndian(extraFieldBuf, counter); + if ((2 + sizeOfRec) > extraFieldLength) { + //If this is the case, then extra data record is corrupt + //skip reading any further extra data records + break; + } + } + + extraDataRecord.setSizeOfData(sizeOfRec); + counter = counter + 2; + + if (sizeOfRec > 0) { + byte[] data = new byte[sizeOfRec]; + System.arraycopy(extraFieldBuf, counter, data, 0, sizeOfRec); + extraDataRecord.setData(data); + } + counter = counter + sizeOfRec; + extraDataList.add(extraDataRecord); + } + if (extraDataList.size() > 0) { + return extraDataList; + } else { + return null; + } + } catch (IOException e) { + throw new ZipException(e); + } + } + + /** + * Reads Zip64 End Of Central Directory Locator + * @return {@link Zip64EndCentralDirLocator} + * @throws ZipException + */ + private Zip64EndCentralDirLocator readZip64EndCentralDirLocator() throws ZipException { + + if (zip4jRaf == null) { + throw new ZipException("invalid file handler when trying to read Zip64EndCentralDirLocator"); + } + + try { + Zip64EndCentralDirLocator zip64EndCentralDirLocator = new Zip64EndCentralDirLocator(); + + setFilePointerToReadZip64EndCentralDirLoc(); + + byte[] intBuff = new byte[4]; + byte[] longBuff = new byte[8]; + + readIntoBuff(zip4jRaf, intBuff); + int signature = Raw.readIntLittleEndian(intBuff, 0); + if (signature == InternalZipConstants.ZIP64ENDCENDIRLOC) { + zipModel.setZip64Format(true); + zip64EndCentralDirLocator.setSignature(signature); + } else { + zipModel.setZip64Format(false); + return null; + } + + readIntoBuff(zip4jRaf, intBuff); + zip64EndCentralDirLocator.setNoOfDiskStartOfZip64EndOfCentralDirRec( + Raw.readIntLittleEndian(intBuff, 0)); + + readIntoBuff(zip4jRaf, longBuff); + zip64EndCentralDirLocator.setOffsetZip64EndOfCentralDirRec( + Raw.readLongLittleEndian(longBuff, 0)); + + readIntoBuff(zip4jRaf, intBuff); + zip64EndCentralDirLocator.setTotNumberOfDiscs(Raw.readIntLittleEndian(intBuff, 0)); + + return zip64EndCentralDirLocator; + + } catch (Exception e) { + throw new ZipException(e); + } + + } + + /** + * Reads Zip64 End of Central Directory Record + * @return {@link Zip64EndCentralDirRecord} + * @throws ZipException + */ + private Zip64EndCentralDirRecord readZip64EndCentralDirRec() throws ZipException { + + if (zipModel.getZip64EndCentralDirLocator() == null) { + throw new ZipException("invalid zip64 end of central directory locator"); + } + + long offSetStartOfZip64CentralDir = + zipModel.getZip64EndCentralDirLocator().getOffsetZip64EndOfCentralDirRec(); + + if (offSetStartOfZip64CentralDir < 0) { + throw new ZipException("invalid offset for start of end of central directory record"); + } + + try { + zip4jRaf.seek(offSetStartOfZip64CentralDir); + + Zip64EndCentralDirRecord zip64EndCentralDirRecord = new Zip64EndCentralDirRecord(); + + byte[] shortBuff = new byte[2]; + byte[] intBuff = new byte[4]; + byte[] longBuff = new byte[8]; + + //signature + readIntoBuff(zip4jRaf, intBuff); + int signature = Raw.readIntLittleEndian(intBuff, 0); + if (signature != InternalZipConstants.ZIP64ENDCENDIRREC) { + throw new ZipException("invalid signature for zip64 end of central directory record"); + } + zip64EndCentralDirRecord.setSignature(signature); + + //size of zip64 end of central directory record + readIntoBuff(zip4jRaf, longBuff); + zip64EndCentralDirRecord.setSizeOfZip64EndCentralDirRec( + Raw.readLongLittleEndian(longBuff, 0)); + + //version made by + readIntoBuff(zip4jRaf, shortBuff); + zip64EndCentralDirRecord.setVersionMadeBy(Raw.readShortLittleEndian(shortBuff, 0)); + + //version needed to extract + readIntoBuff(zip4jRaf, shortBuff); + zip64EndCentralDirRecord.setVersionNeededToExtract(Raw.readShortLittleEndian(shortBuff, 0)); + + //number of this disk + readIntoBuff(zip4jRaf, intBuff); + zip64EndCentralDirRecord.setNoOfThisDisk(Raw.readIntLittleEndian(intBuff, 0)); + + //number of the disk with the start of the central directory + readIntoBuff(zip4jRaf, intBuff); + zip64EndCentralDirRecord.setNoOfThisDiskStartOfCentralDir( + Raw.readIntLittleEndian(intBuff, 0)); + + //total number of entries in the central directory on this disk + readIntoBuff(zip4jRaf, longBuff); + zip64EndCentralDirRecord.setTotNoOfEntriesInCentralDirOnThisDisk( + Raw.readLongLittleEndian(longBuff, 0)); + + //total number of entries in the central directory + readIntoBuff(zip4jRaf, longBuff); + zip64EndCentralDirRecord.setTotNoOfEntriesInCentralDir( + Raw.readLongLittleEndian(longBuff, 0)); + + //size of the central directory + readIntoBuff(zip4jRaf, longBuff); + zip64EndCentralDirRecord.setSizeOfCentralDir(Raw.readLongLittleEndian(longBuff, 0)); + + //offset of start of central directory with respect to the starting disk number + readIntoBuff(zip4jRaf, longBuff); + zip64EndCentralDirRecord.setOffsetStartCenDirWRTStartDiskNo( + Raw.readLongLittleEndian(longBuff, 0)); + + //zip64 extensible data sector + //44 is the size of fixed variables in this record + long extDataSecSize = zip64EndCentralDirRecord.getSizeOfZip64EndCentralDirRec() - 44; + if (extDataSecSize > 0) { + byte[] extDataSecRecBuf = new byte[(int)extDataSecSize]; + readIntoBuff(zip4jRaf, extDataSecRecBuf); + zip64EndCentralDirRecord.setExtensibleDataSector(extDataSecRecBuf); + } + + return zip64EndCentralDirRecord; + + } catch (IOException e) { + throw new ZipException(e); + } + + } + + /** + * Reads Zip64 Extended info and saves it in the {@link FileHeader} + * @param fileHeader + * @throws ZipException + */ + private void readAndSaveZip64ExtendedInfo(FileHeader fileHeader) throws ZipException { + if (fileHeader == null) { + throw new ZipException("file header is null in reading Zip64 Extended Info"); + } + + if (fileHeader.getExtraDataRecords() == null || fileHeader.getExtraDataRecords().size() <= 0) { + return; + } + + Zip64ExtendedInfo zip64ExtendedInfo = readZip64ExtendedInfo( + fileHeader.getExtraDataRecords(), + fileHeader.getUncompressedSize(), + fileHeader.getCompressedSize(), + fileHeader.getOffsetLocalHeader(), + fileHeader.getDiskNumberStart()); + + if (zip64ExtendedInfo != null) { + fileHeader.setZip64ExtendedInfo(zip64ExtendedInfo); + if (zip64ExtendedInfo.getUnCompressedSize() != -1) + fileHeader.setUncompressedSize(zip64ExtendedInfo.getUnCompressedSize()); + + if (zip64ExtendedInfo.getCompressedSize() != -1) + fileHeader.setCompressedSize(zip64ExtendedInfo.getCompressedSize()); + + if (zip64ExtendedInfo.getOffsetLocalHeader() != -1) + fileHeader.setOffsetLocalHeader(zip64ExtendedInfo.getOffsetLocalHeader()); + + if (zip64ExtendedInfo.getDiskNumberStart() != -1) + fileHeader.setDiskNumberStart(zip64ExtendedInfo.getDiskNumberStart()); + } + } + + /** + * Reads Zip64 Extended Info and saves it in the {@link LocalFileHeader} + * @param localFileHeader + * @throws ZipException + */ + private void readAndSaveZip64ExtendedInfo(LocalFileHeader localFileHeader) throws ZipException { + if (localFileHeader == null) { + throw new ZipException("file header is null in reading Zip64 Extended Info"); + } + + if (localFileHeader.getExtraDataRecords() == null || localFileHeader.getExtraDataRecords().size() <= 0) { + return; + } + + Zip64ExtendedInfo zip64ExtendedInfo = readZip64ExtendedInfo( + localFileHeader.getExtraDataRecords(), + localFileHeader.getUncompressedSize(), + localFileHeader.getCompressedSize(), + -1, -1); + + if (zip64ExtendedInfo != null) { + localFileHeader.setZip64ExtendedInfo(zip64ExtendedInfo); + + if (zip64ExtendedInfo.getUnCompressedSize() != -1) + localFileHeader.setUncompressedSize(zip64ExtendedInfo.getUnCompressedSize()); + + if (zip64ExtendedInfo.getCompressedSize() != -1) + localFileHeader.setCompressedSize(zip64ExtendedInfo.getCompressedSize()); + } + } + + /** + * Reads Zip64 Extended Info + * @param extraDataRecords + * @param unCompressedSize + * @param compressedSize + * @param offsetLocalHeader + * @param diskNumberStart + * @return {@link Zip64ExtendedInfo} + * @throws ZipException + */ + private Zip64ExtendedInfo readZip64ExtendedInfo( + ArrayList extraDataRecords, + long unCompressedSize, + long compressedSize, + long offsetLocalHeader, + int diskNumberStart) throws ZipException { + + for (int i = 0; i < extraDataRecords.size(); i++) { + ExtraDataRecord extraDataRecord = (ExtraDataRecord)extraDataRecords.get(i); + if (extraDataRecord == null) { + continue; + } + + if (extraDataRecord.getHeader() == 0x0001) { + + Zip64ExtendedInfo zip64ExtendedInfo = new Zip64ExtendedInfo(); + + byte[] byteBuff = extraDataRecord.getData(); + + if (extraDataRecord.getSizeOfData() <= 0) { + break; + } + byte[] longByteBuff = new byte[8]; + byte[] intByteBuff = new byte[4]; + int counter = 0; + boolean valueAdded = false; + + if (((unCompressedSize & 0xFFFF) == 0xFFFF) && counter < extraDataRecord.getSizeOfData()) { + System.arraycopy(byteBuff, counter, longByteBuff, 0, 8); + long val = Raw.readLongLittleEndian(longByteBuff, 0); + zip64ExtendedInfo.setUnCompressedSize(val); + counter += 8; + valueAdded = true; + } + + if (((compressedSize & 0xFFFF) == 0xFFFF) && counter < extraDataRecord.getSizeOfData()) { + System.arraycopy(byteBuff, counter, longByteBuff, 0, 8); + long val = Raw.readLongLittleEndian(longByteBuff, 0); + zip64ExtendedInfo.setCompressedSize(val); + counter += 8; + valueAdded = true; + } + + if (((offsetLocalHeader & 0xFFFF) == 0xFFFF) && counter < extraDataRecord.getSizeOfData()) { + System.arraycopy(byteBuff, counter, longByteBuff, 0, 8); + long val = Raw.readLongLittleEndian(longByteBuff, 0); + zip64ExtendedInfo.setOffsetLocalHeader(val); + counter += 8; + valueAdded = true; + } + + if (((diskNumberStart & 0xFFFF) == 0xFFFF) && counter < extraDataRecord.getSizeOfData()) { + System.arraycopy(byteBuff, counter, intByteBuff, 0, 4); + int val = Raw.readIntLittleEndian(intByteBuff, 0); + zip64ExtendedInfo.setDiskNumberStart(val); + counter += 8; + valueAdded = true; + } + + if (valueAdded) { + return zip64ExtendedInfo; + } + + break; + } + } + return null; + } + + /** + * Sets the current random access file pointer at the start of signature + * of the zip64 end of central directory record + * @throws ZipException + */ + private void setFilePointerToReadZip64EndCentralDirLoc() throws ZipException { + try { + byte[] ebs = new byte[4]; + long pos = zip4jRaf.length() - InternalZipConstants.ENDHDR; + + do { + zip4jRaf.seek(pos--); + } while (Raw.readLeInt(zip4jRaf, ebs) != InternalZipConstants.ENDSIG); + + // Now the file pointer is at the end of signature of Central Dir Rec + // Seek back with the following values + // 4 -> end of central dir signature + // 4 -> total number of disks + // 8 -> relative offset of the zip64 end of central directory record + // 4 -> number of the disk with the start of the zip64 end of central directory + // 4 -> zip64 end of central dir locator signature + // Refer to Appnote for more information + //TODO: Donot harcorde these values. Make use of ZipConstants + zip4jRaf.seek(zip4jRaf.getFilePointer() - 4 - 4 - 8 - 4 - 4); + } catch (IOException e) { + throw new ZipException(e); + } + } + + /** + * Reads local file header for the given file header + * @param fileHeader + * @return {@link LocalFileHeader} + * @throws ZipException + */ + public LocalFileHeader readLocalFileHeader(FileHeader fileHeader) throws ZipException { + if (fileHeader == null || zip4jRaf == null) { + throw new ZipException("invalid read parameters for local header"); + } + + long locHdrOffset = fileHeader.getOffsetLocalHeader(); + + if (fileHeader.getZip64ExtendedInfo() != null) { + Zip64ExtendedInfo zip64ExtendedInfo = fileHeader.getZip64ExtendedInfo(); + if (zip64ExtendedInfo.getOffsetLocalHeader() > 0) { + locHdrOffset = fileHeader.getOffsetLocalHeader(); + } + } + + if (locHdrOffset < 0) { + throw new ZipException("invalid local header offset"); + } + + try { + zip4jRaf.seek(locHdrOffset); + + int length = 0; + LocalFileHeader localFileHeader = new LocalFileHeader(); + + byte[] shortBuff = new byte[2]; + byte[] intBuff = new byte[4]; + byte[] longBuff = new byte[8]; + + //signature + readIntoBuff(zip4jRaf, intBuff); + int sig = Raw.readIntLittleEndian(intBuff, 0); + if (sig != InternalZipConstants.LOCSIG) { + throw new ZipException("invalid local header signature for file: " + fileHeader.getFileName()); + } + localFileHeader.setSignature(sig); + length += 4; + + //version needed to extract + readIntoBuff(zip4jRaf, shortBuff); + localFileHeader.setVersionNeededToExtract(Raw.readShortLittleEndian(shortBuff, 0)); + length += 2; + + //general purpose bit flag + readIntoBuff(zip4jRaf, shortBuff); + localFileHeader.setFileNameUTF8Encoded((Raw.readShortLittleEndian(shortBuff, 0) & InternalZipConstants.UFT8_NAMES_FLAG) != 0); + int firstByte = shortBuff[0]; + int result = firstByte & 1; + if (result != 0) { + localFileHeader.setEncrypted(true); + } + localFileHeader.setGeneralPurposeFlag(shortBuff); + length += 2; + + //Check if data descriptor exists for local file header + String binary = Integer.toBinaryString(firstByte); + if (binary.length() >= 4) + localFileHeader.setDataDescriptorExists(binary.charAt(3) == '1'); + + //compression method + readIntoBuff(zip4jRaf, shortBuff); + localFileHeader.setCompressionMethod(Raw.readShortLittleEndian(shortBuff, 0)); + length += 2; + + //last mod file time + readIntoBuff(zip4jRaf, intBuff); + localFileHeader.setLastModFileTime(Raw.readIntLittleEndian(intBuff, 0)); + length += 4; + + //crc-32 + readIntoBuff(zip4jRaf, intBuff); + localFileHeader.setCrc32(Raw.readIntLittleEndian(intBuff, 0)); + localFileHeader.setCrcBuff((byte[])intBuff.clone()); + length += 4; + + //compressed size + readIntoBuff(zip4jRaf, intBuff); + longBuff = getLongByteFromIntByte(intBuff); + localFileHeader.setCompressedSize(Raw.readLongLittleEndian(longBuff, 0)); + length += 4; + + //uncompressed size + readIntoBuff(zip4jRaf, intBuff); + longBuff = getLongByteFromIntByte(intBuff); + localFileHeader.setUncompressedSize(Raw.readLongLittleEndian(longBuff, 0)); + length += 4; + + //file name length + readIntoBuff(zip4jRaf, shortBuff); + int fileNameLength = Raw.readShortLittleEndian(shortBuff, 0); + localFileHeader.setFileNameLength(fileNameLength); + length += 2; + + //extra field length + readIntoBuff(zip4jRaf, shortBuff); + int extraFieldLength = Raw.readShortLittleEndian(shortBuff, 0); + localFileHeader.setExtraFieldLength(extraFieldLength); + length += 2; + + //file name + if (fileNameLength > 0) { + byte[] fileNameBuf = new byte[fileNameLength]; + readIntoBuff(zip4jRaf, fileNameBuf); + // Modified after user reported an issue http://www.lingala.net/zip4j/forum/index.php?topic=2.0 +// String fileName = new String(fileNameBuf, "Cp850"); +// String fileName = Zip4jUtil.getCp850EncodedString(fileNameBuf); + String fileName = Zip4jUtil.decodeFileName(fileNameBuf, localFileHeader.isFileNameUTF8Encoded()); + + if (fileName == null) { + throw new ZipException("file name is null, cannot assign file name to local file header"); + } + + if (fileName.indexOf(":" + System.getProperty("file.separator")) >= 0) { + fileName = fileName.substring(fileName.indexOf(":" + System.getProperty("file.separator")) + 2); + } + + localFileHeader.setFileName(fileName); + length += fileNameLength; + } else { + localFileHeader.setFileName(null); + } + + //extra field + readAndSaveExtraDataRecord(localFileHeader); + length += extraFieldLength; + + localFileHeader.setOffsetStartOfData(locHdrOffset + length); + + //Copy password from fileHeader to localFileHeader + localFileHeader.setPassword(fileHeader.getPassword()); + + readAndSaveZip64ExtendedInfo(localFileHeader); + + readAndSaveAESExtraDataRecord(localFileHeader); + + if (localFileHeader.isEncrypted()) { + + if (localFileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + //Do nothing + } else { + if ((firstByte & 64) == 64) { + //hardcoded for now + localFileHeader.setEncryptionMethod(1); + } else { + localFileHeader.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD); +// localFileHeader.setCompressedSize(localFileHeader.getCompressedSize() +// - ZipConstants.STD_DEC_HDR_SIZE); + } + } + + } + + if (localFileHeader.getCrc32() <= 0) { + localFileHeader.setCrc32(fileHeader.getCrc32()); + localFileHeader.setCrcBuff(fileHeader.getCrcBuff()); + } + + if (localFileHeader.getCompressedSize() <= 0) { + localFileHeader.setCompressedSize(fileHeader.getCompressedSize()); + } + + if (localFileHeader.getUncompressedSize() <= 0) { + localFileHeader.setUncompressedSize(fileHeader.getUncompressedSize()); + } + + return localFileHeader; + } catch (IOException e) { + throw new ZipException(e); + } + } + + /** + * Reads AES Extra Data Record and saves it in the {@link FileHeader} + * @param fileHeader + * @throws ZipException + */ + private void readAndSaveAESExtraDataRecord(FileHeader fileHeader) throws ZipException { + if (fileHeader == null) { + throw new ZipException("file header is null in reading Zip64 Extended Info"); + } + + if (fileHeader.getExtraDataRecords() == null || fileHeader.getExtraDataRecords().size() <= 0) { + return; + } + + AESExtraDataRecord aesExtraDataRecord = readAESExtraDataRecord(fileHeader.getExtraDataRecords()); + if (aesExtraDataRecord != null) { + fileHeader.setAesExtraDataRecord(aesExtraDataRecord); + fileHeader.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES); + } + } + + /** + * Reads AES Extra Data Record and saves it in the {@link LocalFileHeader} + * @param localFileHeader + * @throws ZipException + */ + private void readAndSaveAESExtraDataRecord(LocalFileHeader localFileHeader) throws ZipException { + if (localFileHeader == null) { + throw new ZipException("file header is null in reading Zip64 Extended Info"); + } + + if (localFileHeader.getExtraDataRecords() == null || localFileHeader.getExtraDataRecords().size() <= 0) { + return; + } + + AESExtraDataRecord aesExtraDataRecord = readAESExtraDataRecord(localFileHeader.getExtraDataRecords()); + if (aesExtraDataRecord != null) { + localFileHeader.setAesExtraDataRecord(aesExtraDataRecord); + localFileHeader.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES); + } + } + + /** + * Reads AES Extra Data Record + * @param extraDataRecords + * @return {@link AESExtraDataRecord} + * @throws ZipException + */ + private AESExtraDataRecord readAESExtraDataRecord(ArrayList extraDataRecords) throws ZipException { + + if (extraDataRecords == null) { + return null; + } + + for (int i = 0; i < extraDataRecords.size(); i++) { + ExtraDataRecord extraDataRecord = (ExtraDataRecord)extraDataRecords.get(i); + if (extraDataRecord == null) { + continue; + } + + if (extraDataRecord.getHeader() == InternalZipConstants.AESSIG) { + + if (extraDataRecord.getData() == null) { + throw new ZipException("corrput AES extra data records"); + } + + AESExtraDataRecord aesExtraDataRecord = new AESExtraDataRecord(); + + aesExtraDataRecord.setSignature(InternalZipConstants.AESSIG); + aesExtraDataRecord.setDataSize(extraDataRecord.getSizeOfData()); + + byte[] aesData = extraDataRecord.getData(); + aesExtraDataRecord.setVersionNumber(Raw.readShortLittleEndian(aesData, 0)); + byte[] vendorIDBytes = new byte[2]; + System.arraycopy(aesData, 2, vendorIDBytes, 0, 2); + aesExtraDataRecord.setVendorID(new String(vendorIDBytes)); + aesExtraDataRecord.setAesStrength((int)(aesData[4] & 0xFF)); + aesExtraDataRecord.setCompressionMethod(Raw.readShortLittleEndian(aesData, 5)); + + return aesExtraDataRecord; + } + } + + return null; + } + + /** + * Reads buf length of bytes from the input stream to buf + * @param zip4jRaf + * @param buf + * @return byte array + * @throws ZipException + */ + private byte[] readIntoBuff(RandomAccessFile zip4jRaf, byte[] buf) throws ZipException { + try { + if (zip4jRaf.read(buf, 0, buf.length) != -1) { + return buf; + } else { + throw new ZipException("unexpected end of file when reading short buff"); + } + } catch (IOException e) { + throw new ZipException("IOException when reading short buff", e); + } + } + + /** + * Returns a long byte from an int byte by appending last 4 bytes as 0's + * @param intByte + * @return byte array + * @throws ZipException + */ + private byte[] getLongByteFromIntByte(byte[] intByte) throws ZipException { + if (intByte == null) { + throw new ZipException("input parameter is null, cannot expand to 8 bytes"); + } + + if (intByte.length != 4) { + throw new ZipException("invalid byte length, cannot expand to 8 bytes"); + } + + byte[] longBuff = {intByte[0], intByte[1], intByte[2], intByte[3], 0, 0, 0, 0}; + return longBuff; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/core/HeaderWriter.java b/lib/zip4j/src/net/lingala/zip4j/core/HeaderWriter.java new file mode 100644 index 00000000..5e3fdc1e --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/core/HeaderWriter.java @@ -0,0 +1,943 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.core; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.io.SplitOutputStream; +import net.lingala.zip4j.model.AESExtraDataRecord; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.LocalFileHeader; +import net.lingala.zip4j.model.Zip64EndCentralDirLocator; +import net.lingala.zip4j.model.Zip64EndCentralDirRecord; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Raw; +import net.lingala.zip4j.util.Zip4jUtil; + +public class HeaderWriter { + + private final int ZIP64_EXTRA_BUF = 50; + + public int writeLocalFileHeader(ZipModel zipModel, LocalFileHeader localFileHeader, + OutputStream outputStream) throws ZipException { + if (localFileHeader == null) { + throw new ZipException("input parameters are null, cannot write local file header"); + } + + try { + ArrayList byteArrayList = new ArrayList(); + + byte[] shortByte = new byte[2]; + byte[] intByte = new byte[4]; + byte[] longByte = new byte[8]; + byte[] emptyLongByte = {0,0,0,0,0,0,0,0}; + + Raw.writeIntLittleEndian(intByte, 0, localFileHeader.getSignature()); + copyByteArrayToArrayList(intByte, byteArrayList); + Raw.writeShortLittleEndian(shortByte, 0, (short)localFileHeader.getVersionNeededToExtract()); + copyByteArrayToArrayList(shortByte, byteArrayList); + //General Purpose bit flags + copyByteArrayToArrayList(localFileHeader.getGeneralPurposeFlag(), byteArrayList); + //Compression Method + Raw.writeShortLittleEndian(shortByte, 0, (short)localFileHeader.getCompressionMethod()); + copyByteArrayToArrayList(shortByte, byteArrayList); + //File modified time + int dateTime = localFileHeader.getLastModFileTime(); + Raw.writeIntLittleEndian(intByte, 0, (int)dateTime); + copyByteArrayToArrayList(intByte, byteArrayList); + //Skip crc for now - this field will be updated after data is compressed + Raw.writeIntLittleEndian(intByte, 0, (int)localFileHeader.getCrc32()); + copyByteArrayToArrayList(intByte, byteArrayList); + boolean writingZip64Rec = false; + + //compressed & uncompressed size + long uncompressedSize = localFileHeader.getUncompressedSize(); + if (uncompressedSize + ZIP64_EXTRA_BUF >= InternalZipConstants.ZIP_64_LIMIT) { + Raw.writeLongLittleEndian(longByte, 0, InternalZipConstants.ZIP_64_LIMIT); + System.arraycopy(longByte, 0, intByte, 0, 4); + + //Set the uncompressed size to ZipConstants.ZIP_64_LIMIT as + //these values will be stored in Zip64 extra record + copyByteArrayToArrayList(intByte, byteArrayList); + + copyByteArrayToArrayList(intByte, byteArrayList); + zipModel.setZip64Format(true); + writingZip64Rec = true; + localFileHeader.setWriteComprSizeInZip64ExtraRecord(true); + } else { + Raw.writeLongLittleEndian(longByte, 0, localFileHeader.getCompressedSize()); + System.arraycopy(longByte, 0, intByte, 0, 4); + copyByteArrayToArrayList(intByte, byteArrayList); + + Raw.writeLongLittleEndian(longByte, 0, localFileHeader.getUncompressedSize()); + System.arraycopy(longByte, 0, intByte, 0, 4); + //Raw.writeIntLittleEndian(intByte, 0, (int)localFileHeader.getUncompressedSize()); + copyByteArrayToArrayList(intByte, byteArrayList); + + localFileHeader.setWriteComprSizeInZip64ExtraRecord(false); + } + Raw.writeShortLittleEndian(shortByte, 0, (short)localFileHeader.getFileNameLength()); + copyByteArrayToArrayList(shortByte, byteArrayList); + // extra field length + int extraFieldLength = 0; + if (writingZip64Rec) { + extraFieldLength += 20; + } + if (localFileHeader.getAesExtraDataRecord() != null) { + extraFieldLength += 11; + } + Raw.writeShortLittleEndian(shortByte, 0, (short)(extraFieldLength)); + copyByteArrayToArrayList(shortByte, byteArrayList); + if (Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getFileNameCharset())) { + byte[] fileNameBytes = localFileHeader.getFileName().getBytes(zipModel.getFileNameCharset()); + copyByteArrayToArrayList(fileNameBytes, byteArrayList); + } else { + copyByteArrayToArrayList(Zip4jUtil.convertCharset(localFileHeader.getFileName()), byteArrayList); + } + + //Zip64 should be the first extra data record that should be written + //This is NOT according to any specification but if this is changed + //then take care of updateLocalFileHeader for compressed size + if (writingZip64Rec) { + + + //Zip64 header + Raw.writeShortLittleEndian(shortByte, 0, (short)InternalZipConstants.EXTRAFIELDZIP64LENGTH); + copyByteArrayToArrayList(shortByte, byteArrayList); + //Zip64 extra data record size + //hardcoded it to 16 for local file header as we will just write + //compressed and uncompressed file sizes + Raw.writeShortLittleEndian(shortByte, 0, (short)16); + copyByteArrayToArrayList(shortByte, byteArrayList); + //uncompressed size + Raw.writeLongLittleEndian(longByte, 0, localFileHeader.getUncompressedSize()); + copyByteArrayToArrayList(longByte, byteArrayList); + //set compressed size to 0 for now + copyByteArrayToArrayList(emptyLongByte, byteArrayList); + } + + if (localFileHeader.getAesExtraDataRecord() != null) { + AESExtraDataRecord aesExtraDataRecord = localFileHeader.getAesExtraDataRecord(); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getSignature()); + copyByteArrayToArrayList(shortByte, byteArrayList); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getDataSize()); + copyByteArrayToArrayList(shortByte, byteArrayList); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getVersionNumber()); + copyByteArrayToArrayList(shortByte, byteArrayList); + + copyByteArrayToArrayList(aesExtraDataRecord.getVendorID().getBytes(), byteArrayList); + + byte[] aesStrengthBytes = new byte[1]; + aesStrengthBytes[0] = (byte)aesExtraDataRecord.getAesStrength(); + copyByteArrayToArrayList(aesStrengthBytes, byteArrayList); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getCompressionMethod()); + copyByteArrayToArrayList(shortByte, byteArrayList); + } + byte[] lhBytes = byteArrayListToByteArray(byteArrayList); + outputStream.write(lhBytes); + return lhBytes.length; + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + public int writeExtendedLocalHeader(LocalFileHeader localFileHeader, + OutputStream outputStream) throws ZipException, IOException { + if (localFileHeader == null || outputStream == null) { + throw new ZipException("input parameters is null, cannot write extended local header"); + } + + ArrayList byteArrayList = new ArrayList(); + byte[] intByte = new byte[4]; + + //Extended local file header signature + Raw.writeIntLittleEndian(intByte, 0, (int)InternalZipConstants.EXTSIG); + copyByteArrayToArrayList(intByte, byteArrayList); + + //CRC + Raw.writeIntLittleEndian(intByte, 0, (int)localFileHeader.getCrc32()); + copyByteArrayToArrayList(intByte, byteArrayList); + + //compressed size + long compressedSize = localFileHeader.getCompressedSize(); + if (compressedSize >= Integer.MAX_VALUE) { + compressedSize = Integer.MAX_VALUE; + } + Raw.writeIntLittleEndian(intByte, 0, (int)compressedSize); + copyByteArrayToArrayList(intByte, byteArrayList); + + //uncompressed size + long uncompressedSize = localFileHeader.getUncompressedSize(); + if (uncompressedSize >= Integer.MAX_VALUE) { + uncompressedSize = Integer.MAX_VALUE; + } + Raw.writeIntLittleEndian(intByte, 0, (int)uncompressedSize); + copyByteArrayToArrayList(intByte, byteArrayList); + + byte[] extLocHdrBytes = byteArrayListToByteArray(byteArrayList); + outputStream.write(extLocHdrBytes); + return extLocHdrBytes.length; + } + + /** + * Processes zip header data and writes this data to the zip file + * @param zipModel + * @param outputStream + * @throws ZipException + */ + public void finalizeZipFile(ZipModel zipModel, + OutputStream outputStream) throws ZipException { + if (zipModel == null || outputStream == null) { + throw new ZipException("input parameters is null, cannot finalize zip file"); + } + + try { + processHeaderData(zipModel, outputStream); + + long offsetCentralDir = zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir(); + + List headerBytesList = new ArrayList(); + + int sizeOfCentralDir = writeCentralDirectory(zipModel, outputStream, headerBytesList); + + if (zipModel.isZip64Format()) { + if (zipModel.getZip64EndCentralDirRecord() == null) { + zipModel.setZip64EndCentralDirRecord(new Zip64EndCentralDirRecord()); + } + if (zipModel.getZip64EndCentralDirLocator() == null) { + zipModel.setZip64EndCentralDirLocator(new Zip64EndCentralDirLocator()); + } + + zipModel.getZip64EndCentralDirLocator().setOffsetZip64EndOfCentralDirRec(offsetCentralDir + sizeOfCentralDir); + if (outputStream instanceof SplitOutputStream) { + zipModel.getZip64EndCentralDirLocator().setNoOfDiskStartOfZip64EndOfCentralDirRec(((SplitOutputStream)outputStream).getCurrSplitFileCounter()); + zipModel.getZip64EndCentralDirLocator().setTotNumberOfDiscs(((SplitOutputStream)outputStream).getCurrSplitFileCounter() + 1); + } else { + zipModel.getZip64EndCentralDirLocator().setNoOfDiskStartOfZip64EndOfCentralDirRec(0); + zipModel.getZip64EndCentralDirLocator().setTotNumberOfDiscs(1); + } + + writeZip64EndOfCentralDirectoryRecord(zipModel, outputStream, sizeOfCentralDir, offsetCentralDir, headerBytesList); + + writeZip64EndOfCentralDirectoryLocator(zipModel, outputStream, headerBytesList); + } + + writeEndOfCentralDirectoryRecord(zipModel, outputStream, sizeOfCentralDir, offsetCentralDir, headerBytesList); + + writeZipHeaderBytes(zipModel, outputStream, byteArrayListToByteArray(headerBytesList)); + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + /** + * Processes zip header data and writes this data to the zip file without any validations. + * This process is not intended to use for normal operations (adding, deleting, etc) of a zip file. + * This method is used when certain validations need to be skipped (ex: Merging split zip files, + * adding comment to a zip file, etc) + * @param zipModel + * @param outputStream + * @throws ZipException + */ + public void finalizeZipFileWithoutValidations(ZipModel zipModel, OutputStream outputStream) throws ZipException { + if (zipModel == null || outputStream == null) { + throw new ZipException("input parameters is null, cannot finalize zip file without validations"); + } + + try { + + List headerBytesList = new ArrayList(); + + long offsetCentralDir = zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir(); + + int sizeOfCentralDir = writeCentralDirectory(zipModel, outputStream, headerBytesList); + + if (zipModel.isZip64Format()) { + if (zipModel.getZip64EndCentralDirRecord() == null) { + zipModel.setZip64EndCentralDirRecord(new Zip64EndCentralDirRecord()); + } + if (zipModel.getZip64EndCentralDirLocator() == null) { + zipModel.setZip64EndCentralDirLocator(new Zip64EndCentralDirLocator()); + } + + zipModel.getZip64EndCentralDirLocator().setOffsetZip64EndOfCentralDirRec(offsetCentralDir + sizeOfCentralDir); + + writeZip64EndOfCentralDirectoryRecord(zipModel, outputStream, sizeOfCentralDir, offsetCentralDir, headerBytesList); + writeZip64EndOfCentralDirectoryLocator(zipModel, outputStream, headerBytesList); + } + + writeEndOfCentralDirectoryRecord(zipModel, outputStream, sizeOfCentralDir, offsetCentralDir, headerBytesList); + + writeZipHeaderBytes(zipModel, outputStream, byteArrayListToByteArray(headerBytesList)); + } catch(ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + /** + * Writes the zip header data to the zip file + * @param outputStream + * @param buff + * @throws ZipException + */ + private void writeZipHeaderBytes(ZipModel zipModel, OutputStream outputStream, byte[] buff) throws ZipException { + if (buff == null) { + throw new ZipException("invalid buff to write as zip headers"); + } + + try { + if (outputStream instanceof SplitOutputStream) { + if (((SplitOutputStream)outputStream).checkBuffSizeAndStartNextSplitFile(buff.length)) { + finalizeZipFile(zipModel, outputStream); + return; + } + } + + outputStream.write(buff); + } catch (IOException e) { + throw new ZipException(e); + } + } + + /** + * Fills the header data in the zip model + * @param zipModel + * @param outputStream + * @throws ZipException + */ + private void processHeaderData(ZipModel zipModel, OutputStream outputStream) throws ZipException { + try { + int currSplitFileCounter = 0; + if (outputStream instanceof SplitOutputStream) { + zipModel.getEndCentralDirRecord().setOffsetOfStartOfCentralDir( + ((SplitOutputStream)outputStream).getFilePointer()); + currSplitFileCounter = ((SplitOutputStream)outputStream).getCurrSplitFileCounter(); + + } + + if (zipModel.isZip64Format()) { + if (zipModel.getZip64EndCentralDirRecord() == null) { + zipModel.setZip64EndCentralDirRecord(new Zip64EndCentralDirRecord()); + } + if (zipModel.getZip64EndCentralDirLocator() == null) { + zipModel.setZip64EndCentralDirLocator(new Zip64EndCentralDirLocator()); + } + + zipModel.getZip64EndCentralDirLocator().setNoOfDiskStartOfZip64EndOfCentralDirRec(currSplitFileCounter); + zipModel.getZip64EndCentralDirLocator().setTotNumberOfDiscs(currSplitFileCounter + 1); + } + zipModel.getEndCentralDirRecord().setNoOfThisDisk(currSplitFileCounter); + zipModel.getEndCentralDirRecord().setNoOfThisDiskStartOfCentralDir(currSplitFileCounter); + } catch (IOException e) { + throw new ZipException(e); + } + } + + /** + * Writes central directory header data to an array list + * @param zipModel + * @param outputStream + * @param headerBytesList + * @return size of central directory + * @throws ZipException + */ + private int writeCentralDirectory(ZipModel zipModel, + OutputStream outputStream, List headerBytesList) throws ZipException { + if (zipModel == null || outputStream == null) { + throw new ZipException("input parameters is null, cannot write central directory"); + } + + if (zipModel.getCentralDirectory() == null || + zipModel.getCentralDirectory().getFileHeaders() == null || + zipModel.getCentralDirectory().getFileHeaders().size() <= 0) { + return 0; + } + + int sizeOfCentralDir = 0; + for (int i = 0; i < zipModel.getCentralDirectory().getFileHeaders().size(); i++) { + FileHeader fileHeader = (FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i); + int sizeOfFileHeader = writeFileHeader(zipModel, fileHeader, outputStream, headerBytesList); + sizeOfCentralDir += sizeOfFileHeader; + } + return sizeOfCentralDir; + } + + private int writeFileHeader(ZipModel zipModel, FileHeader fileHeader, + OutputStream outputStream, List headerBytesList) throws ZipException { + + if (fileHeader == null || outputStream == null) { + throw new ZipException("input parameters is null, cannot write local file header"); + } + + try { + int sizeOfFileHeader = 0; + + byte[] shortByte = new byte[2]; + byte[] intByte = new byte[4]; + byte[] longByte = new byte[8]; + final byte[] emptyShortByte = {0,0}; + final byte[] emptyIntByte = {0,0,0,0}; + + boolean writeZip64FileSize = false; + boolean writeZip64OffsetLocalHeader = false; + + Raw.writeIntLittleEndian(intByte, 0, fileHeader.getSignature()); + copyByteArrayToArrayList(intByte, headerBytesList); + sizeOfFileHeader += 4; + + Raw.writeShortLittleEndian(shortByte, 0, (short)fileHeader.getVersionMadeBy()); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + Raw.writeShortLittleEndian(shortByte, 0, (short)fileHeader.getVersionNeededToExtract()); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + copyByteArrayToArrayList(fileHeader.getGeneralPurposeFlag(), headerBytesList); + sizeOfFileHeader += 2; + + Raw.writeShortLittleEndian(shortByte, 0, (short)fileHeader.getCompressionMethod()); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + int dateTime = fileHeader.getLastModFileTime(); + Raw.writeIntLittleEndian(intByte, 0, dateTime); + copyByteArrayToArrayList(intByte, headerBytesList); + sizeOfFileHeader += 4; + + Raw.writeIntLittleEndian(intByte, 0, (int)(fileHeader.getCrc32())); + copyByteArrayToArrayList(intByte, headerBytesList); + sizeOfFileHeader += 4; + + if (fileHeader.getCompressedSize() >= InternalZipConstants.ZIP_64_LIMIT || + fileHeader.getUncompressedSize() + ZIP64_EXTRA_BUF >= InternalZipConstants.ZIP_64_LIMIT) { + Raw.writeLongLittleEndian(longByte, 0, InternalZipConstants.ZIP_64_LIMIT); + System.arraycopy(longByte, 0, intByte, 0, 4); + + copyByteArrayToArrayList(intByte, headerBytesList); + sizeOfFileHeader += 4; + + copyByteArrayToArrayList(intByte, headerBytesList); + sizeOfFileHeader += 4; + + writeZip64FileSize = true; + } else { + Raw.writeLongLittleEndian(longByte, 0, fileHeader.getCompressedSize()); + System.arraycopy(longByte, 0, intByte, 0, 4); +// Raw.writeIntLittleEndian(intByte, 0, (int)fileHeader.getCompressedSize()); + copyByteArrayToArrayList(intByte, headerBytesList); + sizeOfFileHeader += 4; + + Raw.writeLongLittleEndian(longByte, 0, fileHeader.getUncompressedSize()); + System.arraycopy(longByte, 0, intByte, 0, 4); +// Raw.writeIntLittleEndian(intByte, 0, (int)fileHeader.getUncompressedSize()); + copyByteArrayToArrayList(intByte, headerBytesList); + sizeOfFileHeader += 4; + } + + Raw.writeShortLittleEndian(shortByte, 0, (short)fileHeader.getFileNameLength()); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + //Compute offset bytes before extra field is written for Zip64 compatibility + //NOTE: this data is not written now, but written at a later point + byte[] offsetLocalHeaderBytes = new byte[4]; + if (fileHeader.getOffsetLocalHeader() > InternalZipConstants.ZIP_64_LIMIT) { + Raw.writeLongLittleEndian(longByte, 0, InternalZipConstants.ZIP_64_LIMIT); + System.arraycopy(longByte, 0, offsetLocalHeaderBytes, 0, 4); + writeZip64OffsetLocalHeader = true; + } else { + Raw.writeLongLittleEndian(longByte, 0, fileHeader.getOffsetLocalHeader()); + System.arraycopy(longByte, 0, offsetLocalHeaderBytes, 0, 4); + } + + // extra field length + int extraFieldLength = 0; + if (writeZip64FileSize || writeZip64OffsetLocalHeader) { + extraFieldLength += 4; + if (writeZip64FileSize) + extraFieldLength += 16; + if (writeZip64OffsetLocalHeader) + extraFieldLength += 8; + } + if (fileHeader.getAesExtraDataRecord() != null) { + extraFieldLength += 11; + } + Raw.writeShortLittleEndian(shortByte, 0, (short)(extraFieldLength)); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + //Skip file comment length for now + copyByteArrayToArrayList(emptyShortByte, headerBytesList); + sizeOfFileHeader += 2; + + //Skip disk number start for now + Raw.writeShortLittleEndian(shortByte, 0, (short)(fileHeader.getDiskNumberStart())); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + //Skip internal file attributes for now + copyByteArrayToArrayList(emptyShortByte, headerBytesList); + sizeOfFileHeader += 2; + + //External file attributes + if (fileHeader.getExternalFileAttr() != null) { + copyByteArrayToArrayList(fileHeader.getExternalFileAttr(), headerBytesList); + } else { + copyByteArrayToArrayList(emptyIntByte, headerBytesList); + } + sizeOfFileHeader += 4; + + //offset local header + //this data is computed above + copyByteArrayToArrayList(offsetLocalHeaderBytes, headerBytesList); + sizeOfFileHeader += 4; + + if (Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getFileNameCharset())) { + byte[] fileNameBytes = fileHeader.getFileName().getBytes(zipModel.getFileNameCharset()); + copyByteArrayToArrayList(fileNameBytes, headerBytesList); + sizeOfFileHeader += fileNameBytes.length; + } else { + copyByteArrayToArrayList(Zip4jUtil.convertCharset(fileHeader.getFileName()), headerBytesList); + sizeOfFileHeader += Zip4jUtil.getEncodedStringLength(fileHeader.getFileName()); + } + + if (writeZip64FileSize || writeZip64OffsetLocalHeader) { + zipModel.setZip64Format(true); + + //Zip64 header + Raw.writeShortLittleEndian(shortByte, 0, (short)InternalZipConstants.EXTRAFIELDZIP64LENGTH); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + //Zip64 extra data record size + int dataSize = 0; + + if (writeZip64FileSize) { + dataSize += 16; + } + if (writeZip64OffsetLocalHeader) { + dataSize += 8; + } + + Raw.writeShortLittleEndian(shortByte, 0, (short)dataSize); + copyByteArrayToArrayList(shortByte, headerBytesList); + sizeOfFileHeader += 2; + + if (writeZip64FileSize) { + Raw.writeLongLittleEndian(longByte, 0, fileHeader.getUncompressedSize()); + copyByteArrayToArrayList(longByte, headerBytesList); + sizeOfFileHeader += 8; + + Raw.writeLongLittleEndian(longByte, 0, fileHeader.getCompressedSize()); + copyByteArrayToArrayList(longByte, headerBytesList); + sizeOfFileHeader += 8; + } + + if (writeZip64OffsetLocalHeader) { + Raw.writeLongLittleEndian(longByte, 0, fileHeader.getOffsetLocalHeader()); + copyByteArrayToArrayList(longByte, headerBytesList); + sizeOfFileHeader += 8; + } + } + + if (fileHeader.getAesExtraDataRecord() != null) { + AESExtraDataRecord aesExtraDataRecord = fileHeader.getAesExtraDataRecord(); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getSignature()); + copyByteArrayToArrayList(shortByte, headerBytesList); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getDataSize()); + copyByteArrayToArrayList(shortByte, headerBytesList); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getVersionNumber()); + copyByteArrayToArrayList(shortByte, headerBytesList); + + copyByteArrayToArrayList(aesExtraDataRecord.getVendorID().getBytes(), headerBytesList); + + byte[] aesStrengthBytes = new byte[1]; + aesStrengthBytes[0] = (byte)aesExtraDataRecord.getAesStrength(); + copyByteArrayToArrayList(aesStrengthBytes, headerBytesList); + + Raw.writeShortLittleEndian(shortByte, 0, (short)aesExtraDataRecord.getCompressionMethod()); + copyByteArrayToArrayList(shortByte, headerBytesList); + + sizeOfFileHeader += 11; + } + +// outputStream.write(byteArrayListToByteArray(headerBytesList)); + + return sizeOfFileHeader; + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void writeZip64EndOfCentralDirectoryRecord(ZipModel zipModel, + OutputStream outputStream, int sizeOfCentralDir, + long offsetCentralDir, List headerBytesList) throws ZipException { + if (zipModel == null || outputStream == null) { + throw new ZipException("zip model or output stream is null, cannot write zip64 end of central directory record"); + } + + try { + + byte[] shortByte = new byte[2]; + byte[] emptyShortByte = {0,0}; + byte[] intByte = new byte[4]; + byte[] longByte = new byte[8]; + + //zip64 end of central dir signature + Raw.writeIntLittleEndian(intByte, 0, (int)InternalZipConstants.ZIP64ENDCENDIRREC); + copyByteArrayToArrayList(intByte, headerBytesList); + + //size of zip64 end of central directory record + Raw.writeLongLittleEndian(longByte, 0, (long)44); + copyByteArrayToArrayList(longByte, headerBytesList); + + //version made by + //version needed to extract + if (zipModel.getCentralDirectory() != null && + zipModel.getCentralDirectory().getFileHeaders() != null && + zipModel.getCentralDirectory().getFileHeaders().size() > 0) { + Raw.writeShortLittleEndian(shortByte, 0, + (short)((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(0)).getVersionMadeBy()); + copyByteArrayToArrayList(shortByte, headerBytesList); + + Raw.writeShortLittleEndian(shortByte, 0, + (short)((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(0)).getVersionNeededToExtract()); + copyByteArrayToArrayList(shortByte, headerBytesList); + } else { + copyByteArrayToArrayList(emptyShortByte, headerBytesList); + copyByteArrayToArrayList(emptyShortByte, headerBytesList); + } + + //number of this disk + Raw.writeIntLittleEndian(intByte, 0, zipModel.getEndCentralDirRecord().getNoOfThisDisk()); + copyByteArrayToArrayList(intByte, headerBytesList); + + //number of the disk with start of central directory + Raw.writeIntLittleEndian(intByte, 0, zipModel.getEndCentralDirRecord().getNoOfThisDiskStartOfCentralDir()); + copyByteArrayToArrayList(intByte, headerBytesList); + + //total number of entries in the central directory on this disk + int numEntries = 0; + int numEntriesOnThisDisk = 0; + if (zipModel.getCentralDirectory() == null || + zipModel.getCentralDirectory().getFileHeaders() == null) { + throw new ZipException("invalid central directory/file headers, " + + "cannot write end of central directory record"); + } else { + numEntries = zipModel.getCentralDirectory().getFileHeaders().size(); + if (zipModel.isSplitArchive()) { + countNumberOfFileHeaderEntriesOnDisk(zipModel.getCentralDirectory().getFileHeaders(), + zipModel.getEndCentralDirRecord().getNoOfThisDisk()); + } else { + numEntriesOnThisDisk = numEntries; + } + } + Raw.writeLongLittleEndian(longByte, 0, numEntriesOnThisDisk); + copyByteArrayToArrayList(longByte, headerBytesList); + + //Total number of entries in central directory + Raw.writeLongLittleEndian(longByte, 0, numEntries); + copyByteArrayToArrayList(longByte, headerBytesList); + + //Size of central directory + Raw.writeLongLittleEndian(longByte, 0, sizeOfCentralDir); + copyByteArrayToArrayList(longByte, headerBytesList); + + //offset of start of central directory with respect to the starting disk number + Raw.writeLongLittleEndian(longByte, 0, offsetCentralDir); + copyByteArrayToArrayList(longByte, headerBytesList); + + } catch (ZipException zipException) { + throw zipException; + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void writeZip64EndOfCentralDirectoryLocator(ZipModel zipModel, + OutputStream outputStream, List headerBytesList) throws ZipException { + if (zipModel == null || outputStream == null) { + throw new ZipException("zip model or output stream is null, cannot write zip64 end of central directory locator"); + } + + try { + + byte[] intByte = new byte[4]; + byte[] longByte = new byte[8]; + + //zip64 end of central dir locator signature + Raw.writeIntLittleEndian(intByte, 0, (int)InternalZipConstants.ZIP64ENDCENDIRLOC); + copyByteArrayToArrayList(intByte, headerBytesList); + + //number of the disk with the start of the zip64 end of central directory + Raw.writeIntLittleEndian(intByte, 0, zipModel.getZip64EndCentralDirLocator().getNoOfDiskStartOfZip64EndOfCentralDirRec()); + copyByteArrayToArrayList(intByte, headerBytesList); + + //relative offset of the zip64 end of central directory record + Raw.writeLongLittleEndian(longByte, 0, zipModel.getZip64EndCentralDirLocator().getOffsetZip64EndOfCentralDirRec()); + copyByteArrayToArrayList(longByte, headerBytesList); + + //total number of disks + Raw.writeIntLittleEndian(intByte, 0, zipModel.getZip64EndCentralDirLocator().getTotNumberOfDiscs()); + copyByteArrayToArrayList(intByte, headerBytesList); + } catch (ZipException zipException) { + throw zipException; + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void writeEndOfCentralDirectoryRecord(ZipModel zipModel, + OutputStream outputStream, + int sizeOfCentralDir, + long offsetCentralDir, + List headrBytesList) throws ZipException { + if (zipModel == null || outputStream == null) { + throw new ZipException("zip model or output stream is null, cannot write end of central directory record"); + } + + try { + + byte[] shortByte = new byte[2]; + byte[] intByte = new byte[4]; + byte[] longByte = new byte[8]; + + //End of central directory signature + Raw.writeIntLittleEndian(intByte, 0, (int)zipModel.getEndCentralDirRecord().getSignature()); + copyByteArrayToArrayList(intByte, headrBytesList); + + //number of this disk + Raw.writeShortLittleEndian(shortByte, 0, (short)(zipModel.getEndCentralDirRecord().getNoOfThisDisk())); + copyByteArrayToArrayList(shortByte, headrBytesList); + + //number of the disk with start of central directory + Raw.writeShortLittleEndian(shortByte, 0, (short)(zipModel.getEndCentralDirRecord().getNoOfThisDiskStartOfCentralDir())); + copyByteArrayToArrayList(shortByte, headrBytesList); + + //Total number of entries in central directory on this disk + int numEntries = 0; + int numEntriesOnThisDisk = 0; + if (zipModel.getCentralDirectory() == null || + zipModel.getCentralDirectory().getFileHeaders() == null) { + throw new ZipException("invalid central directory/file headers, " + + "cannot write end of central directory record"); + } else { + numEntries = zipModel.getCentralDirectory().getFileHeaders().size(); + if (zipModel.isSplitArchive()) { + numEntriesOnThisDisk = countNumberOfFileHeaderEntriesOnDisk(zipModel.getCentralDirectory().getFileHeaders(), + zipModel.getEndCentralDirRecord().getNoOfThisDisk()); + } else { + numEntriesOnThisDisk = numEntries; + } + } + Raw.writeShortLittleEndian(shortByte, 0, (short)numEntriesOnThisDisk); + copyByteArrayToArrayList(shortByte, headrBytesList); + + //Total number of entries in central directory + Raw.writeShortLittleEndian(shortByte, 0, (short)numEntries); + copyByteArrayToArrayList(shortByte, headrBytesList); + + //Size of central directory + Raw.writeIntLittleEndian(intByte, 0, sizeOfCentralDir); + copyByteArrayToArrayList(intByte, headrBytesList); + + //Offset central directory + if (offsetCentralDir > InternalZipConstants.ZIP_64_LIMIT) { + Raw.writeLongLittleEndian(longByte, 0, InternalZipConstants.ZIP_64_LIMIT); + System.arraycopy(longByte, 0, intByte, 0, 4); + copyByteArrayToArrayList(intByte, headrBytesList); + } else { + Raw.writeLongLittleEndian(longByte, 0, offsetCentralDir); + System.arraycopy(longByte, 0, intByte, 0, 4); +// Raw.writeIntLittleEndian(intByte, 0, (int)offsetCentralDir); + copyByteArrayToArrayList(intByte, headrBytesList); + } + + //Zip File comment length + int commentLength = 0; + if (zipModel.getEndCentralDirRecord().getComment() != null) { + commentLength = zipModel.getEndCentralDirRecord().getCommentLength(); + } + Raw.writeShortLittleEndian(shortByte, 0, (short)commentLength); + copyByteArrayToArrayList(shortByte, headrBytesList); + + //Comment + if (commentLength > 0) { + copyByteArrayToArrayList(zipModel.getEndCentralDirRecord().getCommentBytes(), headrBytesList); + } + + } catch (Exception e) { + throw new ZipException(e); + } + } + + public void updateLocalFileHeader(LocalFileHeader localFileHeader, long offset, + int toUpdate, ZipModel zipModel, byte[] bytesToWrite, int noOfDisk, SplitOutputStream outputStream) throws ZipException { + if (localFileHeader == null || offset < 0 || zipModel == null) { + throw new ZipException("invalid input parameters, cannot update local file header"); + } + + try { + boolean closeFlag = false; + SplitOutputStream currOutputStream = null; + + if (noOfDisk != outputStream.getCurrSplitFileCounter()) { + File zipFile = new File(zipModel.getZipFile()); + String parentFile = zipFile.getParent(); + String fileNameWithoutExt = Zip4jUtil.getZipFileNameWithoutExt(zipFile.getName()); + String fileName = parentFile + System.getProperty("file.separator"); + if (noOfDisk < 9) { + fileName += fileNameWithoutExt + ".z0" + (noOfDisk + 1); + } else { + fileName += fileNameWithoutExt + ".z" + (noOfDisk + 1); + } + currOutputStream = new SplitOutputStream(new File(fileName)); + closeFlag = true; + } else { + currOutputStream = outputStream; + } + + long currOffset = currOutputStream.getFilePointer(); + + switch (toUpdate) { + case InternalZipConstants.UPDATE_LFH_CRC: + currOutputStream.seek(offset + toUpdate); + currOutputStream.write(bytesToWrite); + break; + case InternalZipConstants.UPDATE_LFH_COMP_SIZE: + case InternalZipConstants.UPDATE_LFH_UNCOMP_SIZE: + updateCompressedSizeInLocalFileHeader(currOutputStream, localFileHeader, + offset, toUpdate, bytesToWrite, zipModel.isZip64Format()); + break; + default: + break; + } + if (closeFlag) { + currOutputStream.close(); + } else { + outputStream.seek(currOffset); + } + + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void updateCompressedSizeInLocalFileHeader(SplitOutputStream outputStream, LocalFileHeader localFileHeader, + long offset, long toUpdate, byte[] bytesToWrite, boolean isZip64Format) throws ZipException { + + if (outputStream == null) { + throw new ZipException("invalid output stream, cannot update compressed size for local file header"); + } + + try { + if (localFileHeader.isWriteComprSizeInZip64ExtraRecord()) { + if (bytesToWrite.length != 8) { + throw new ZipException("attempting to write a non 8-byte compressed size block for a zip64 file"); + } + + //4 - compressed size + //4 - uncomprssed size + //2 - file name length + //2 - extra field length + //file name length + //2 - Zip64 signature + //2 - size of zip64 data + //8 - crc + //8 - compressed size + //8 - uncompressed size + long zip64CompressedSizeOffset = offset + toUpdate + 4 + 4 + 2 + 2 + localFileHeader.getFileNameLength() + 2 + 2 + 8; + if (toUpdate == InternalZipConstants.UPDATE_LFH_UNCOMP_SIZE) { + zip64CompressedSizeOffset += 8; + } + outputStream.seek(zip64CompressedSizeOffset); + outputStream.write(bytesToWrite); + } else { + outputStream.seek(offset + toUpdate); + outputStream.write(bytesToWrite); + } + } catch (IOException e) { + throw new ZipException(e); + } + + } + + private void copyByteArrayToArrayList(byte[] byteArray, List arrayList) throws ZipException { + if (arrayList == null || byteArray == null) { + throw new ZipException("one of the input parameters is null, cannot copy byte array to array list"); + } + + for (int i = 0; i < byteArray.length; i++) { + arrayList.add(Byte.toString(byteArray[i])); + } + } + + private byte[] byteArrayListToByteArray(List arrayList) throws ZipException { + if (arrayList == null) { + throw new ZipException("input byte array list is null, cannot conver to byte array"); + } + + if (arrayList.size() <= 0) { + return null; + } + + byte[] retBytes = new byte[arrayList.size()]; + + for (int i = 0; i < arrayList.size(); i++) { + retBytes[i] = Byte.parseByte((String)arrayList.get(i)); + } + + return retBytes; + } + + private int countNumberOfFileHeaderEntriesOnDisk(ArrayList fileHeaders, + int numOfDisk) throws ZipException { + if (fileHeaders == null) { + throw new ZipException("file headers are null, cannot calculate number of entries on this disk"); + } + + int noEntries = 0; + for (int i = 0; i < fileHeaders.size(); i++) { + FileHeader fileHeader = (FileHeader)fileHeaders.get(i); + if (fileHeader.getDiskNumberStart() == numOfDisk) { + noEntries++; + } + } + return noEntries; + } + +} \ No newline at end of file diff --git a/lib/zip4j/src/net/lingala/zip4j/core/ZipFile.java b/lib/zip4j/src/net/lingala/zip4j/core/ZipFile.java new file mode 100644 index 00000000..0daba779 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/core/ZipFile.java @@ -0,0 +1,1041 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.core; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.List; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.exception.ZipExceptionConstants; +import net.lingala.zip4j.io.ZipInputStream; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.UnzipParameters; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.model.ZipParameters; +import net.lingala.zip4j.progress.ProgressMonitor; +import net.lingala.zip4j.unzip.Unzip; +import net.lingala.zip4j.util.ArchiveMaintainer; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jUtil; +import net.lingala.zip4j.zip.ZipEngine; + +/** + * Base class to handle zip files. Some of the operations supported + * in this class are:
+ * + * + */ + +public class ZipFile { + + private String file; + private int mode; + private ZipModel zipModel; + private boolean isEncrypted; + private ProgressMonitor progressMonitor; + private boolean runInThread; + private String fileNameCharset; + + /** + * Creates a new Zip File Object with the given zip file path. + * If the zip file does not exist, it is not created at this point. + * @param zipFile + * @throws ZipException + */ + public ZipFile(String zipFile) throws ZipException { + this(new File(zipFile)); + } + + /** + * Creates a new Zip File Object with the input file. + * If the zip file does not exist, it is not created at this point. + * @param zipFile + * @throws ZipException + */ + public ZipFile(File zipFile) throws ZipException { + if (zipFile == null) { + throw new ZipException("Input zip file parameter is not null", + ZipExceptionConstants.inputZipParamIsNull); + } + + this.file = zipFile.getPath(); + this.mode = InternalZipConstants.MODE_UNZIP; + this.progressMonitor = new ProgressMonitor(); + this.runInThread = false; + } + + /** + * Creates a zip file and adds the source file to the zip file. If the zip file + * exists then this method throws an exception. Parameters such as compression type, etc + * can be set in the input parameters + * @param sourceFile - File to be added to the zip file + * @param parameters - parameters to create the zip file + * @throws ZipException + */ + public void createZipFile(File sourceFile, ZipParameters parameters) throws ZipException { + ArrayList sourceFileList = new ArrayList(); + sourceFileList.add(sourceFile); + createZipFile(sourceFileList, parameters, false, -1); + } + + /** + * Creates a zip file and adds the source file to the zip file. If the zip file + * exists then this method throws an exception. Parameters such as compression type, etc + * can be set in the input parameters. While the method addFile/addFiles also creates the + * zip file if it does not exist, the main functionality of this method is to create a split + * zip file. To create a split zip file, set the splitArchive parameter to true with a valid + * splitLength. Split Length has to be more than 65536 bytes + * @param sourceFile - File to be added to the zip file + * @param parameters - parameters to create the zip file + * @param splitArchive - if archive has to be split or not + * @param splitLength - if archive has to be split, then length in bytes at which it has to be split + * @throws ZipException + */ + public void createZipFile(File sourceFile, ZipParameters parameters, + boolean splitArchive, long splitLength) throws ZipException { + + ArrayList sourceFileList = new ArrayList(); + sourceFileList.add(sourceFile); + createZipFile(sourceFileList, parameters, splitArchive, splitLength); + } + + /** + * Creates a zip file and adds the list of source file(s) to the zip file. If the zip file + * exists then this method throws an exception. Parameters such as compression type, etc + * can be set in the input parameters + * @param sourceFileList - File to be added to the zip file + * @param parameters - parameters to create the zip file + * @throws ZipException + */ + public void createZipFile(ArrayList sourceFileList, + ZipParameters parameters) throws ZipException { + createZipFile(sourceFileList, parameters, false, -1); + } + + /** + * Creates a zip file and adds the list of source file(s) to the zip file. If the zip file + * exists then this method throws an exception. Parameters such as compression type, etc + * can be set in the input parameters. While the method addFile/addFiles also creates the + * zip file if it does not exist, the main functionality of this method is to create a split + * zip file. To create a split zip file, set the splitArchive parameter to true with a valid + * splitLength. Split Length has to be more than 65536 bytes + * @param sourceFileList - File to be added to the zip file + * @param parameters - zip parameters for this file list + * @param splitArchive - if archive has to be split or not + * @param splitLength - if archive has to be split, then length in bytes at which it has to be split + * @throws ZipException + */ + public void createZipFile(ArrayList sourceFileList, ZipParameters parameters, + boolean splitArchive, long splitLength) throws ZipException { + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(file)) { + throw new ZipException("zip file path is empty"); + } + + if (Zip4jUtil.checkFileExists(file)) { + throw new ZipException("zip file: " + file + " already exists. To add files to existing zip file use addFile method"); + } + + if (sourceFileList == null) { + throw new ZipException("input file ArrayList is null, cannot create zip file"); + } + + if (!Zip4jUtil.checkArrayListTypes(sourceFileList, InternalZipConstants.LIST_TYPE_FILE)) { + throw new ZipException("One or more elements in the input ArrayList is not of type File"); + } + + createNewZipModel(); + this.zipModel.setSplitArchive(splitArchive); + this.zipModel.setSplitLength(splitLength); + addFiles(sourceFileList, parameters); + } + + /** + * Creates a zip file and adds the files/folders from the specified folder to the zip file. + * This method does the same functionality as in addFolder method except that this method + * can also create split zip files when adding a folder. To create a split zip file, set the + * splitArchive parameter to true and specify the splitLength. Split length has to be more than + * or equal to 65536 bytes. Note that this method throws an exception if the zip file already + * exists. + * @param folderToAdd + * @param parameters + * @param splitArchive + * @param splitLength + * @throws ZipException + */ + public void createZipFileFromFolder(String folderToAdd, ZipParameters parameters, + boolean splitArchive, long splitLength) throws ZipException { + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(folderToAdd)) { + throw new ZipException("folderToAdd is empty or null, cannot create Zip File from folder"); + } + + createZipFileFromFolder(new File(folderToAdd), parameters, splitArchive, splitLength); + + } + + /** + * Creates a zip file and adds the files/folders from the specified folder to the zip file. + * This method does the same functionality as in addFolder method except that this method + * can also create split zip files when adding a folder. To create a split zip file, set the + * splitArchive parameter to true and specify the splitLength. Split length has to be more than + * or equal to 65536 bytes. Note that this method throws an exception if the zip file already + * exists. + * @param folderToAdd + * @param parameters + * @param splitArchive + * @param splitLength + * @throws ZipException + */ + public void createZipFileFromFolder(File folderToAdd, ZipParameters parameters, + boolean splitArchive, long splitLength) throws ZipException { + + if (folderToAdd == null) { + throw new ZipException("folderToAdd is null, cannot create zip file from folder"); + } + + if (parameters == null) { + throw new ZipException("input parameters are null, cannot create zip file from folder"); + } + + if (Zip4jUtil.checkFileExists(file)) { + throw new ZipException("zip file: " + file + " already exists. To add files to existing zip file use addFolder method"); + } + + createNewZipModel(); + this.zipModel.setSplitArchive(splitArchive); + if (splitArchive) + this.zipModel.setSplitLength(splitLength); + + addFolder(folderToAdd, parameters, false); + } + + /** + * Adds input source file to the zip file. If zip file does not exist, then + * this method creates a new zip file. Parameters such as compression type, etc + * can be set in the input parameters. + * @param sourceFile - File to tbe added to the zip file + * @param parameters - zip parameters for this file + * @throws ZipException + */ + public void addFile(File sourceFile, ZipParameters parameters) throws ZipException { + ArrayList sourceFileList = new ArrayList(); + sourceFileList.add(sourceFile); + addFiles(sourceFileList, parameters); + } + + /** + * Adds the list of input files to the zip file. If zip file does not exist, then + * this method creates a new zip file. Parameters such as compression type, etc + * can be set in the input parameters. + * @param sourceFileList + * @param parameters + * @throws ZipException + */ + public void addFiles(ArrayList sourceFileList, ZipParameters parameters) throws ZipException { + + checkZipModel(); + + if (this.zipModel == null) { + throw new ZipException("internal error: zip model is null"); + } + + if (sourceFileList == null) { + throw new ZipException("input file ArrayList is null, cannot add files"); + } + + if (!Zip4jUtil.checkArrayListTypes(sourceFileList, InternalZipConstants.LIST_TYPE_FILE)) { + throw new ZipException("One or more elements in the input ArrayList is not of type File"); + } + + if (parameters == null) { + throw new ZipException("input parameters are null, cannot add files to zip"); + } + + if (progressMonitor.getState() == ProgressMonitor.STATE_BUSY) { + throw new ZipException("invalid operation - Zip4j is in busy state"); + } + + if (Zip4jUtil.checkFileExists(file)) { + if (zipModel.isSplitArchive()) { + throw new ZipException("Zip file already exists. Zip file format does not allow updating split/spanned files"); + } + } + + ZipEngine zipEngine = new ZipEngine(zipModel); + zipEngine.addFiles(sourceFileList, parameters, progressMonitor, runInThread); + } + + /** + * Adds the folder in the given path to the zip file. If zip file does not exist, + * then a new zip file is created. If input folder path is invalid then an exception + * is thrown. Zip parameters for the files in the folder to be added can be set in + * the input parameters + * @param path + * @param parameters + * @throws ZipException + */ + public void addFolder(String path, ZipParameters parameters) throws ZipException { + if (!Zip4jUtil.isStringNotNullAndNotEmpty(path)) { + throw new ZipException("input path is null or empty, cannot add folder to zip file"); + } + + addFolder(new File(path), parameters); + } + + /** + * Adds the folder in the given file object to the zip file. If zip file does not exist, + * then a new zip file is created. If input folder is invalid then an exception + * is thrown. Zip parameters for the files in the folder to be added can be set in + * the input parameters + * @param path + * @param parameters + * @throws ZipException + */ + public void addFolder(File path, ZipParameters parameters) throws ZipException { + if (path == null) { + throw new ZipException("input path is null, cannot add folder to zip file"); + } + + if (parameters == null) { + throw new ZipException("input parameters are null, cannot add folder to zip file"); + } + + addFolder(path, parameters, true); + } + + /** + * Internal method to add a folder to the zip file. + * @param path + * @param parameters + * @param checkSplitArchive + * @throws ZipException + */ + private void addFolder(File path, ZipParameters parameters, + boolean checkSplitArchive) throws ZipException { + + checkZipModel(); + + if (this.zipModel == null) { + throw new ZipException("internal error: zip model is null"); + } + + if (checkSplitArchive) { + if (this.zipModel.isSplitArchive()) { + throw new ZipException("This is a split archive. Zip file format does not allow updating split/spanned files"); + } + } + + ZipEngine zipEngine = new ZipEngine(zipModel); + zipEngine.addFolderToZip(path, parameters, progressMonitor, runInThread); + + } + + /** + * Creates a new entry in the zip file and adds the content of the inputstream to the + * zip file. ZipParameters.isSourceExternalStream and ZipParameters.fileNameInZip have to be + * set before in the input parameters. If the file name ends with / or \, this method treats the + * content as a directory. Setting the flag ProgressMonitor.setRunInThread to true will have + * no effect for this method and hence this method cannot be used to add content to zip in + * thread mode + * @param inputStream + * @param parameters + * @throws ZipException + */ + public void addStream(InputStream inputStream, ZipParameters parameters) throws ZipException { + if (inputStream == null) { + throw new ZipException("inputstream is null, cannot add file to zip"); + } + + if (parameters == null) { + throw new ZipException("zip parameters are null"); + } + + this.setRunInThread(false); + + checkZipModel(); + + if (this.zipModel == null) { + throw new ZipException("internal error: zip model is null"); + } + + if (Zip4jUtil.checkFileExists(file)) { + if (zipModel.isSplitArchive()) { + throw new ZipException("Zip file already exists. Zip file format does not allow updating split/spanned files"); + } + } + + ZipEngine zipEngine = new ZipEngine(zipModel); + zipEngine.addStreamToZip(inputStream, parameters); + } + + /** + * Reads the zip header information for this zip file. If the zip file + * does not exist, then this method throws an exception.

+ * Note: This method does not read local file header information + * @throws ZipException + */ + private void readZipInfo() throws ZipException { + + if (!Zip4jUtil.checkFileExists(file)) { + throw new ZipException("zip file does not exist"); + } + + if (!Zip4jUtil.checkFileReadAccess(this.file)) { + throw new ZipException("no read access for the input zip file"); + } + + if (this.mode != InternalZipConstants.MODE_UNZIP) { + throw new ZipException("Invalid mode"); + } + + RandomAccessFile raf = null; + try { + raf = new RandomAccessFile(new File(file), InternalZipConstants.READ_MODE); + + if (zipModel == null) { + + HeaderReader headerReader = new HeaderReader(raf); + zipModel = headerReader.readAllHeaders(this.fileNameCharset); + if (zipModel != null) { + zipModel.setZipFile(file); + } + } + } catch (FileNotFoundException e) { + throw new ZipException(e); + } finally { + if (raf != null) { + try { + raf.close(); + } catch (IOException e) { + //ignore + } + } + } + } + + /** + * Extracts all the files in the given zip file to the input destination path. + * If zip file does not exist or destination path is invalid then an + * exception is thrown. + * @param destPath + * @throws ZipException + */ + public void extractAll(String destPath) throws ZipException { + extractAll(destPath, null); + + } + + /** + * Extracts all the files in the given zip file to the input destination path. + * If zip file does not exist or destination path is invalid then an + * exception is thrown. + * @param destPath + * @param unzipParameters + * @throws ZipException + */ + public void extractAll(String destPath, + UnzipParameters unzipParameters) throws ZipException { + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(destPath)) { + throw new ZipException("output path is null or invalid"); + } + + if (!Zip4jUtil.checkOutputFolder(destPath)) { + throw new ZipException("invalid output path"); + } + + if (zipModel == null) { + readZipInfo(); + } + + // Throw an exception if zipModel is still null + if (zipModel == null) { + throw new ZipException("Internal error occurred when extracting zip file"); + } + + if (progressMonitor.getState() == ProgressMonitor.STATE_BUSY) { + throw new ZipException("invalid operation - Zip4j is in busy state"); + } + + Unzip unzip = new Unzip(zipModel); + unzip.extractAll(unzipParameters, destPath, progressMonitor, runInThread); + + } + + /** + * Extracts a specific file from the zip file to the destination path. + * If destination path is invalid, then this method throws an exception. + * @param fileHeader + * @param destPath + * @throws ZipException + */ + public void extractFile(FileHeader fileHeader, String destPath) throws ZipException { + extractFile(fileHeader, destPath, null); + } + + /** + * Extracts a specific file from the zip file to the destination path. + * If destination path is invalid, then this method throws an exception. + *

+ * If newFileName is not null or empty, newly created file name will be replaced by + * the value in newFileName. If this value is null, then the file name will be the + * value in FileHeader.getFileName + * @param fileHeader + * @param destPath + * @param unzipParameters + * @throws ZipException + */ + public void extractFile(FileHeader fileHeader, + String destPath, UnzipParameters unzipParameters) throws ZipException { + extractFile(fileHeader, destPath, unzipParameters, null); + } + + /** + * Extracts a specific file from the zip file to the destination path. + * If destination path is invalid, then this method throws an exception. + * @param fileHeader + * @param destPath + * @param unzipParameters + * @param newFileName + * @throws ZipException + */ + public void extractFile(FileHeader fileHeader, String destPath, + UnzipParameters unzipParameters, String newFileName) throws ZipException { + + if (fileHeader == null) { + throw new ZipException("input file header is null, cannot extract file"); + } + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(destPath)) { + throw new ZipException("destination path is empty or null, cannot extract file"); + } + + readZipInfo(); + + if (progressMonitor.getState() == ProgressMonitor.STATE_BUSY) { + throw new ZipException("invalid operation - Zip4j is in busy state"); + } + + fileHeader.extractFile(zipModel, destPath, unzipParameters, newFileName, progressMonitor, runInThread); + + } + + /** + * Extracts a specific file from the zip file to the destination path. + * This method first finds the necessary file header from the input file name. + *

+ * File name is relative file name in the zip file. For example if a zip file contains + * a file "a.txt", then to extract this file, input file name has to be "a.txt". Another + * example is if there is a file "b.txt" in a folder "abc" in the zip file, then the + * input file name has to be abc/b.txt + *

+ * Throws an exception if file header could not be found for the given file name or if + * the destination path is invalid + * @param fileName + * @param destPath + * @throws ZipException + */ + public void extractFile(String fileName, String destPath) throws ZipException { + extractFile(fileName, destPath, null); + } + + /** + * Extracts a specific file from the zip file to the destination path. + * This method first finds the necessary file header from the input file name. + *

+ * File name is relative file name in the zip file. For example if a zip file contains + * a file "a.txt", then to extract this file, input file name has to be "a.txt". Another + * example is if there is a file "b.txt" in a folder "abc" in the zip file, then the + * input file name has to be abc/b.txt + *

+ * Throws an exception if file header could not be found for the given file name or if + * the destination path is invalid + * @param fileName + * @param destPath + * @param unzipParameters + * @throws ZipException + */ + public void extractFile(String fileName, + String destPath, UnzipParameters unzipParameters) throws ZipException { + extractFile(fileName, destPath, unzipParameters, null); + } + + /** + * Extracts a specific file from the zip file to the destination path. + * This method first finds the necessary file header from the input file name. + *

+ * File name is relative file name in the zip file. For example if a zip file contains + * a file "a.txt", then to extract this file, input file name has to be "a.txt". Another + * example is if there is a file "b.txt" in a folder "abc" in the zip file, then the + * input file name has to be abc/b.txt + *

+ * If newFileName is not null or empty, newly created file name will be replaced by + * the value in newFileName. If this value is null, then the file name will be the + * value in FileHeader.getFileName + *

+ * Throws an exception if file header could not be found for the given file name or if + * the destination path is invalid + * @param fileName + * @param destPath + * @param unzipParameters + * @param newFileName + * @throws ZipException + */ + public void extractFile(String fileName, String destPath, + UnzipParameters unzipParameters, String newFileName) throws ZipException { + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("file to extract is null or empty, cannot extract file"); + } + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(destPath)) { + throw new ZipException("destination string path is empty or null, cannot extract file"); + } + + readZipInfo(); + + FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName); + + if (fileHeader == null) { + throw new ZipException("file header not found for given file name, cannot extract file"); + } + + if (progressMonitor.getState() == ProgressMonitor.STATE_BUSY) { + throw new ZipException("invalid operation - Zip4j is in busy state"); + } + + fileHeader.extractFile(zipModel, destPath, unzipParameters, newFileName, progressMonitor, runInThread); + + } + + /** + * Sets the password for the zip file.
+ * Note: For security reasons, usage of this method is discouraged. Use + * setPassword(char[]) instead. As strings are immutable, they cannot be wiped + * out from memory explicitly after usage. Therefore, usage of Strings to store + * passwords is discouraged. More info here: + * http://docs.oracle.com/javase/1.5.0/docs/guide/security/jce/JCERefGuide.html#PBEEx + * @param password + * @throws ZipException + */ + public void setPassword(String password) throws ZipException { + if (!Zip4jUtil.isStringNotNullAndNotEmpty(password)) { + throw new NullPointerException(); + } + setPassword(password.toCharArray()); + } + + /** + * Sets the password for the zip file + * @param password + * @throws ZipException + */ + public void setPassword(char[] password) throws ZipException { + if (zipModel == null) { + readZipInfo(); + if (zipModel == null) { + throw new ZipException("Zip Model is null"); + } + } + + if (zipModel.getCentralDirectory() == null || zipModel.getCentralDirectory().getFileHeaders() == null) { + throw new ZipException("invalid zip file"); + } + + for (int i = 0; i < zipModel.getCentralDirectory().getFileHeaders().size(); i++) { + if (zipModel.getCentralDirectory().getFileHeaders().get(i) != null) { + if (((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).isEncrypted()) { + ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).setPassword(password); + } + } + } + } + + /** + * Returns the list of file headers in the zip file. Throws an exception if the + * zip file does not exist + * @return list of file headers + * @throws ZipException + */ + public List getFileHeaders() throws ZipException { + readZipInfo(); + if (zipModel == null || zipModel.getCentralDirectory() == null) { + return null; + } + return zipModel.getCentralDirectory().getFileHeaders(); + } + + /** + * Returns FileHeader if a file header with the given fileHeader + * string exists in the zip model: If not returns null + * @param fileName + * @return FileHeader + * @throws ZipException + */ + public FileHeader getFileHeader(String fileName) throws ZipException { + if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("input file name is emtpy or null, cannot get FileHeader"); + } + + readZipInfo(); + if (zipModel == null || zipModel.getCentralDirectory() == null) { + return null; + } + + return Zip4jUtil.getFileHeader(zipModel, fileName); + } + + /** + * Checks to see if the zip file is encrypted + * @return true if encrypted, false if not + * @throws ZipException + */ + public boolean isEncrypted() throws ZipException { + if (zipModel == null) { + readZipInfo(); + if (zipModel == null) { + throw new ZipException("Zip Model is null"); + } + } + + if (zipModel.getCentralDirectory() == null || zipModel.getCentralDirectory().getFileHeaders() == null) { + throw new ZipException("invalid zip file"); + } + + ArrayList fileHeaderList = zipModel.getCentralDirectory().getFileHeaders(); + for (int i = 0; i < fileHeaderList.size(); i++) { + FileHeader fileHeader = (FileHeader)fileHeaderList.get(i); + if (fileHeader != null) { + if (fileHeader.isEncrypted()) { + isEncrypted = true; + break; + } + } + } + + return isEncrypted; + } + + /** + * Checks if the zip file is a split archive + * @return true if split archive, false if not + * @throws ZipException + */ + public boolean isSplitArchive() throws ZipException { + + if (zipModel == null) { + readZipInfo(); + if (zipModel == null) { + throw new ZipException("Zip Model is null"); + } + } + + return zipModel.isSplitArchive(); + + } + + /** + * Removes the file provided in the input paramters from the zip file. + * This method first finds the file header and then removes the file. + * If file does not exist, then this method throws an exception. + * If zip file is a split zip file, then this method throws an exception as + * zip specification does not allow for updating split zip archives. + * @param fileName + * @throws ZipException + */ + public void removeFile(String fileName) throws ZipException { + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("file name is empty or null, cannot remove file"); + } + + if (zipModel == null) { + if (Zip4jUtil.checkFileExists(file)) { + readZipInfo(); + } + } + + if (zipModel.isSplitArchive()) { + throw new ZipException("Zip file format does not allow updating split/spanned files"); + } + + FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName); + if (fileHeader == null) { + throw new ZipException("could not find file header for file: " + fileName); + } + + removeFile(fileHeader); + } + + /** + * Removes the file provided in the input file header from the zip file. + * If zip file is a split zip file, then this method throws an exception as + * zip specification does not allow for updating split zip archives. + * @param fileHeader + * @throws ZipException + */ + public void removeFile(FileHeader fileHeader) throws ZipException { + if (fileHeader == null) { + throw new ZipException("file header is null, cannot remove file"); + } + + if (zipModel == null) { + if (Zip4jUtil.checkFileExists(file)) { + readZipInfo(); + } + } + + if (zipModel.isSplitArchive()) { + throw new ZipException("Zip file format does not allow updating split/spanned files"); + } + + ArchiveMaintainer archiveMaintainer = new ArchiveMaintainer(); + archiveMaintainer.initProgressMonitorForRemoveOp(zipModel, fileHeader, progressMonitor); + archiveMaintainer.removeZipFile(zipModel, fileHeader, progressMonitor, runInThread); + } + + /** + * Merges split zip files into a single zip file without the need to extract the + * files in the archive + * @param outputZipFile + * @throws ZipException + */ + public void mergeSplitFiles(File outputZipFile) throws ZipException { + if (outputZipFile == null) { + throw new ZipException("outputZipFile is null, cannot merge split files"); + } + + if (outputZipFile.exists()) { + throw new ZipException("output Zip File already exists"); + } + + checkZipModel(); + + if (this.zipModel == null) { + throw new ZipException("zip model is null, corrupt zip file?"); + } + + ArchiveMaintainer archiveMaintainer = new ArchiveMaintainer(); + archiveMaintainer.initProgressMonitorForMergeOp(zipModel, progressMonitor); + archiveMaintainer.mergeSplitZipFiles(zipModel, outputZipFile, progressMonitor, runInThread); + } + + /** + * Sets comment for the Zip file + * @param comment + * @throws ZipException + */ + public void setComment(String comment) throws ZipException { + if (comment == null) { + throw new ZipException("input comment is null, cannot update zip file"); + } + + if (!Zip4jUtil.checkFileExists(file)) { + throw new ZipException("zip file does not exist, cannot set comment for zip file"); + } + + readZipInfo(); + + if (this.zipModel == null) { + throw new ZipException("zipModel is null, cannot update zip file"); + } + + if (zipModel.getEndCentralDirRecord() == null) { + throw new ZipException("end of central directory is null, cannot set comment"); + } + + ArchiveMaintainer archiveMaintainer = new ArchiveMaintainer(); + archiveMaintainer.setComment(zipModel, comment); + } + + /** + * Returns the comment set for the Zip file + * @return String + * @throws ZipException + */ + public String getComment() throws ZipException { + return getComment(null); + } + + /** + * Returns the comment set for the Zip file in the input encoding + * @param encoding + * @return String + * @throws ZipException + */ + public String getComment(String encoding) throws ZipException { + if (encoding == null) { + if (Zip4jUtil.isSupportedCharset(InternalZipConstants.CHARSET_COMMENTS_DEFAULT)) { + encoding = InternalZipConstants.CHARSET_COMMENTS_DEFAULT; + } else { + encoding = InternalZipConstants.CHARSET_DEFAULT; + } + } + + if (Zip4jUtil.checkFileExists(file)) { + checkZipModel(); + } else { + throw new ZipException("zip file does not exist, cannot read comment"); + } + + if (this.zipModel == null) { + throw new ZipException("zip model is null, cannot read comment"); + } + + if (this.zipModel.getEndCentralDirRecord() == null) { + throw new ZipException("end of central directory record is null, cannot read comment"); + } + + if (this.zipModel.getEndCentralDirRecord().getCommentBytes() == null || + this.zipModel.getEndCentralDirRecord().getCommentBytes().length <= 0) { + return null; + } + + try { + return new String(this.zipModel.getEndCentralDirRecord().getCommentBytes(), encoding); + } catch (UnsupportedEncodingException e) { + throw new ZipException(e); + } + } + + /** + * Loads the zip model if zip model is null and if zip file exists. + * @throws ZipException + */ + private void checkZipModel() throws ZipException { + if (this.zipModel == null) { + if (Zip4jUtil.checkFileExists(file)) { + readZipInfo(); + } else { + createNewZipModel(); + } + } + } + + /** + * Creates a new instance of zip model + * @throws ZipException + */ + private void createNewZipModel() { + zipModel = new ZipModel(); + zipModel.setZipFile(file); + zipModel.setFileNameCharset(fileNameCharset); + } + + /** + * Zip4j will encode all the file names with the input charset. This method throws + * an exception if the Charset is not supported + * @param charsetName + * @throws ZipException + */ + public void setFileNameCharset(String charsetName) throws ZipException { + if (!Zip4jUtil.isStringNotNullAndNotEmpty(charsetName)) { + throw new ZipException("null or empty charset name"); + } + + if (!Zip4jUtil.isSupportedCharset(charsetName)) { + throw new ZipException("unsupported charset: " + charsetName); + } + + this.fileNameCharset = charsetName; + } + + /** + * Returns an input stream for reading the contents of the Zip file corresponding + * to the input FileHeader. Throws an exception if the FileHeader does not exist + * in the ZipFile + * @param fileHeader + * @return ZipInputStream + * @throws ZipException + */ + public ZipInputStream getInputStream(FileHeader fileHeader) throws ZipException { + if (fileHeader == null) { + throw new ZipException("FileHeader is null, cannot get InputStream"); + } + + checkZipModel(); + + if (zipModel == null) { + throw new ZipException("zip model is null, cannot get inputstream"); + } + + Unzip unzip = new Unzip(zipModel); + return unzip.getInputStream(fileHeader); + } + + /** + * Checks to see if the input zip file is a valid zip file. This method + * will try to read zip headers. If headers are read successfully, this + * method returns true else false + * @return boolean + * @since 1.2.3 + */ + public boolean isValidZipFile() { + try { + readZipInfo(); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * Returns the full file path+names of all split zip files + * in an ArrayList. For example: If a split zip file(abc.zip) has a 10 split parts + * this method returns an array list with path + "abc.z01", path + "abc.z02", etc. + * Returns null if the zip file does not exist + * @return ArrayList of Strings + * @throws ZipException + */ + public ArrayList getSplitZipFiles() throws ZipException { + checkZipModel(); + return Zip4jUtil.getSplitZipFiles(zipModel); + } + + public ProgressMonitor getProgressMonitor() { + return progressMonitor; + } + + public boolean isRunInThread() { + return runInThread; + } + + public void setRunInThread(boolean runInThread) { + this.runInThread = runInThread; + } + + /** + * Returns the File object of the zip file + * @return File + */ + public File getFile() { + return new File(this.file); + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/AESDecrypter.java b/lib/zip4j/src/net/lingala/zip4j/crypto/AESDecrypter.java new file mode 100644 index 00000000..1266c90e --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/AESDecrypter.java @@ -0,0 +1,226 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto; + +import java.util.Arrays; + +import net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF; +import net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine; +import net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters; +import net.lingala.zip4j.crypto.engine.AESEngine; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.exception.ZipExceptionConstants; +import net.lingala.zip4j.model.AESExtraDataRecord; +import net.lingala.zip4j.model.LocalFileHeader; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Raw; +import net.lingala.zip4j.util.Zip4jConstants; + +public class AESDecrypter implements IDecrypter { + + private LocalFileHeader localFileHeader; + private AESEngine aesEngine; + private MacBasedPRF mac; + + private final int PASSWORD_VERIFIER_LENGTH = 2; + private int KEY_LENGTH; + private int MAC_LENGTH; + private int SALT_LENGTH; + + private byte[] aesKey; + private byte[] macKey; + private byte[] derivedPasswordVerifier; + private byte[] storedMac; + + private int nonce = 1; + private byte[] iv; + private byte[] counterBlock; + private int loopCount = 0; + + public AESDecrypter(LocalFileHeader localFileHeader, + byte[] salt, byte[] passwordVerifier) throws ZipException { + + if (localFileHeader == null) { + throw new ZipException("one of the input parameters is null in AESDecryptor Constructor"); + } + + this.localFileHeader = localFileHeader; + this.storedMac = null; + iv = new byte[InternalZipConstants.AES_BLOCK_SIZE]; + counterBlock = new byte[InternalZipConstants.AES_BLOCK_SIZE]; + init(salt, passwordVerifier); + } + + private void init(byte[] salt, byte[] passwordVerifier) throws ZipException { + if (localFileHeader == null) { + throw new ZipException("invalid file header in init method of AESDecryptor"); + } + + AESExtraDataRecord aesExtraDataRecord = localFileHeader.getAesExtraDataRecord(); + if (aesExtraDataRecord == null) { + throw new ZipException("invalid aes extra data record - in init method of AESDecryptor"); + } + + switch (aesExtraDataRecord.getAesStrength()) { + case Zip4jConstants.AES_STRENGTH_128: + KEY_LENGTH = 16; + MAC_LENGTH = 16; + SALT_LENGTH = 8; + break; + case Zip4jConstants.AES_STRENGTH_192: + KEY_LENGTH = 24; + MAC_LENGTH = 24; + SALT_LENGTH = 12; + break; + case Zip4jConstants.AES_STRENGTH_256: + KEY_LENGTH = 32; + MAC_LENGTH = 32; + SALT_LENGTH = 16; + break; + default: + throw new ZipException("invalid aes key strength for file: " + localFileHeader.getFileName()); + } + + if (localFileHeader.getPassword() == null || localFileHeader.getPassword().length <= 0) { + throw new ZipException("empty or null password provided for AES Decryptor"); + } + + byte[] derivedKey = deriveKey(salt, localFileHeader.getPassword()); + if (derivedKey == null || + derivedKey.length != (KEY_LENGTH + MAC_LENGTH + PASSWORD_VERIFIER_LENGTH)) { + throw new ZipException("invalid derived key"); + } + + aesKey = new byte[KEY_LENGTH]; + macKey = new byte[MAC_LENGTH]; + derivedPasswordVerifier = new byte[PASSWORD_VERIFIER_LENGTH]; + + System.arraycopy(derivedKey, 0, aesKey, 0, KEY_LENGTH); + System.arraycopy(derivedKey, KEY_LENGTH, macKey, 0, MAC_LENGTH); + System.arraycopy(derivedKey, KEY_LENGTH + MAC_LENGTH, derivedPasswordVerifier, 0, PASSWORD_VERIFIER_LENGTH); + + if (derivedPasswordVerifier == null) { + throw new ZipException("invalid derived password verifier for AES"); + } + + if (!Arrays.equals(passwordVerifier, derivedPasswordVerifier)) { + throw new ZipException("Wrong Password for file: " + localFileHeader.getFileName(), ZipExceptionConstants.WRONG_PASSWORD); + } + + aesEngine = new AESEngine(aesKey); + mac = new MacBasedPRF("HmacSHA1"); + mac.init(macKey); + } + + public int decryptData(byte[] buff, int start, int len) throws ZipException { + + if (aesEngine == null) { + throw new ZipException("AES not initialized properly"); + } + + try { + + for (int j = start; j < (start + len); j += InternalZipConstants.AES_BLOCK_SIZE) { + loopCount = (j + InternalZipConstants.AES_BLOCK_SIZE <= (start + len)) ? + InternalZipConstants.AES_BLOCK_SIZE : ((start + len) - j); + + mac.update(buff, j, loopCount); + Raw.prepareBuffAESIVBytes(iv, nonce, InternalZipConstants.AES_BLOCK_SIZE); + aesEngine.processBlock(iv, counterBlock); + + for (int k = 0; k < loopCount; k++) { + buff[j + k] = (byte)(buff[j + k] ^ counterBlock[k]); + } + + nonce++; + } + + return len; + + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + public int decryptData(byte[] buff) throws ZipException { + return decryptData(buff, 0, buff.length); + } + + private byte[] deriveKey(byte[] salt, char[] password) throws ZipException { + try { + PBKDF2Parameters p = new PBKDF2Parameters("HmacSHA1", "ISO-8859-1", + salt, 1000); + PBKDF2Engine e = new PBKDF2Engine(p); + byte[] derivedKey = e.deriveKey(password, KEY_LENGTH + MAC_LENGTH + PASSWORD_VERIFIER_LENGTH); + return derivedKey; + } catch (Exception e) { + throw new ZipException(e); + } + } + + public int getPasswordVerifierLength() { + return PASSWORD_VERIFIER_LENGTH; + } + + public int getSaltLength() { + return SALT_LENGTH; + } + + public byte[] getCalculatedAuthenticationBytes() { + return mac.doFinal(); + } + + public void setStoredMac(byte[] storedMac) { + this.storedMac = storedMac; + } + + public byte[] getStoredMac() { + return storedMac; + } + +// public byte[] getStoredMac() throws ZipException { +// if (raf == null) { +// throw new ZipException("attempting to read MAC on closed file handle"); +// } +// +// try { +// byte[] storedMacBytes = new byte[InternalZipConstants.AES_AUTH_LENGTH]; +// int bytesRead = raf.read(storedMacBytes); +// if (bytesRead != InternalZipConstants.AES_AUTH_LENGTH) { +// if (zipModel.isSplitArchive()) { +//// unzipEngine.startNextSplitFile(); +// if (bytesRead == -1) bytesRead = 0; +// int newlyRead = raf.read(storedMacBytes, bytesRead, InternalZipConstants.AES_AUTH_LENGTH - bytesRead); +// bytesRead += newlyRead; +// if (bytesRead != InternalZipConstants.AES_AUTH_LENGTH) { +// throw new ZipException("invalid number of bytes read for stored MAC after starting split file"); +// } +// } else { +// throw new ZipException("invalid number of bytes read for stored MAC"); +// } +// } +// return storedMacBytes; +// } catch (IOException e) { +// throw new ZipException(e); +// } catch (Exception e) { +// throw new ZipException(e); +// } +// +// } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/AESEncrpyter.java b/lib/zip4j/src/net/lingala/zip4j/crypto/AESEncrpyter.java new file mode 100644 index 00000000..666d00df --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/AESEncrpyter.java @@ -0,0 +1,214 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto; + +import java.util.Random; + +import net.lingala.zip4j.crypto.PBKDF2.MacBasedPRF; +import net.lingala.zip4j.crypto.PBKDF2.PBKDF2Engine; +import net.lingala.zip4j.crypto.PBKDF2.PBKDF2Parameters; +import net.lingala.zip4j.crypto.engine.AESEngine; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Raw; +import net.lingala.zip4j.util.Zip4jConstants; + +public class AESEncrpyter implements IEncrypter { + + private char[] password; + private int keyStrength; + private AESEngine aesEngine; + private MacBasedPRF mac; + + private int KEY_LENGTH; + private int MAC_LENGTH; + private int SALT_LENGTH; + private final int PASSWORD_VERIFIER_LENGTH = 2; + + private byte[] aesKey; + private byte[] macKey; + private byte[] derivedPasswordVerifier; + private byte[] saltBytes; + + private boolean finished; + + private int nonce = 1; + private int loopCount = 0; + + private byte[] iv; + private byte[] counterBlock; + + public AESEncrpyter(char[] password, int keyStrength) throws ZipException { + if (password == null || password.length == 0) { + throw new ZipException("input password is empty or null in AES encrypter constructor"); + } + if (keyStrength != Zip4jConstants.AES_STRENGTH_128 && + keyStrength != Zip4jConstants.AES_STRENGTH_256) { + throw new ZipException("Invalid key strength in AES encrypter constructor"); + } + + this.password = password; + this.keyStrength = keyStrength; + this.finished = false; + counterBlock = new byte[InternalZipConstants.AES_BLOCK_SIZE]; + iv = new byte[InternalZipConstants.AES_BLOCK_SIZE]; + init(); + } + + private void init() throws ZipException { + switch (keyStrength) { + case Zip4jConstants.AES_STRENGTH_128: + KEY_LENGTH = 16; + MAC_LENGTH = 16; + SALT_LENGTH = 8; + break; + case Zip4jConstants.AES_STRENGTH_256: + KEY_LENGTH = 32; + MAC_LENGTH = 32; + SALT_LENGTH = 16; + break; + default: + throw new ZipException("invalid aes key strength, cannot determine key sizes"); + } + + saltBytes = generateSalt(SALT_LENGTH); + byte[] keyBytes = deriveKey(saltBytes, password); + + if (keyBytes == null || keyBytes.length != (KEY_LENGTH + MAC_LENGTH + PASSWORD_VERIFIER_LENGTH)) { + throw new ZipException("invalid key generated, cannot decrypt file"); + } + + aesKey = new byte[KEY_LENGTH]; + macKey = new byte[MAC_LENGTH]; + derivedPasswordVerifier = new byte[PASSWORD_VERIFIER_LENGTH]; + + System.arraycopy(keyBytes, 0, aesKey, 0, KEY_LENGTH); + System.arraycopy(keyBytes, KEY_LENGTH, macKey, 0, MAC_LENGTH); + System.arraycopy(keyBytes, KEY_LENGTH + MAC_LENGTH, derivedPasswordVerifier, 0, PASSWORD_VERIFIER_LENGTH); + + aesEngine = new AESEngine(aesKey); + mac = new MacBasedPRF("HmacSHA1"); + mac.init(macKey); + } + + private byte[] deriveKey(byte[] salt, char[] password) throws ZipException { + try { + PBKDF2Parameters p = new PBKDF2Parameters("HmacSHA1", "ISO-8859-1", + salt, 1000); + PBKDF2Engine e = new PBKDF2Engine(p); + byte[] derivedKey = e.deriveKey(password, KEY_LENGTH + MAC_LENGTH + PASSWORD_VERIFIER_LENGTH); + return derivedKey; + } catch (Exception e) { + throw new ZipException(e); + } + } + + public int encryptData(byte[] buff) throws ZipException { + + if (buff == null) { + throw new ZipException("input bytes are null, cannot perform AES encrpytion"); + } + return encryptData(buff, 0, buff.length); + } + + public int encryptData(byte[] buff, int start, int len) throws ZipException { + + if (finished) { + // A non 16 byte block has already been passed to encrypter + // non 16 byte block should be the last block of compressed data in AES encryption + // any more encryption will lead to corruption of data + throw new ZipException("AES Encrypter is in finished state (A non 16 byte block has already been passed to encrypter)"); + } + + if (len%16!=0) { + this.finished = true; + } + + for (int j = start; j < (start + len); j += InternalZipConstants.AES_BLOCK_SIZE) { + loopCount = (j + InternalZipConstants.AES_BLOCK_SIZE <= (start + len)) ? + InternalZipConstants.AES_BLOCK_SIZE : ((start + len) - j); + + Raw.prepareBuffAESIVBytes(iv, nonce, InternalZipConstants.AES_BLOCK_SIZE); + aesEngine.processBlock(iv, counterBlock); + + for (int k = 0; k < loopCount; k++) { + buff[j + k] = (byte)(buff[j + k] ^ counterBlock[k]); + } + + mac.update(buff, j, loopCount); + nonce++; + } + + return len; + } + + private static byte[] generateSalt(int size) throws ZipException { + + if (size != 8 && size != 16) { + throw new ZipException("invalid salt size, cannot generate salt"); + } + + int rounds = 0; + + if (size == 8) + rounds = 2; + if (size == 16) + rounds = 4; + + byte[] salt = new byte[size]; + for( int j = 0; j < rounds; j++ ) { + Random rand = new Random(); + int i = rand.nextInt(); + salt[0+j*4] = (byte)(i>>24); + salt[1+j*4] = (byte)(i>>16); + salt[2+j*4] = (byte)(i>>8); + salt[3+j*4] = (byte)i; + } + return salt; + } + + public byte[] getFinalMac() { + byte[] rawMacBytes = mac.doFinal(); + byte[] macBytes = new byte[10]; + System.arraycopy(rawMacBytes, 0, macBytes, 0, 10); + return macBytes; + } + + public byte[] getDerivedPasswordVerifier() { + return derivedPasswordVerifier; + } + + public void setDerivedPasswordVerifier(byte[] derivedPasswordVerifier) { + this.derivedPasswordVerifier = derivedPasswordVerifier; + } + + public byte[] getSaltBytes() { + return saltBytes; + } + + public void setSaltBytes(byte[] saltBytes) { + this.saltBytes = saltBytes; + } + + public int getSaltLength() { + return SALT_LENGTH; + } + + public int getPasswordVeriifierLength() { + return PASSWORD_VERIFIER_LENGTH; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/IDecrypter.java b/lib/zip4j/src/net/lingala/zip4j/crypto/IDecrypter.java new file mode 100644 index 00000000..dd6e6bfa --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/IDecrypter.java @@ -0,0 +1,27 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto; + +import net.lingala.zip4j.exception.ZipException; + +public interface IDecrypter { + + public int decryptData(byte[] buff, int start, int len) throws ZipException; + + public int decryptData(byte[] buff) throws ZipException; + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/IEncrypter.java b/lib/zip4j/src/net/lingala/zip4j/crypto/IEncrypter.java new file mode 100644 index 00000000..d869160c --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/IEncrypter.java @@ -0,0 +1,27 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto; + +import net.lingala.zip4j.exception.ZipException; + +public interface IEncrypter { + + public int encryptData(byte[] buff) throws ZipException; + + public int encryptData(byte[] buff, int start, int len) throws ZipException; + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/BinTools.java b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/BinTools.java new file mode 100644 index 00000000..975d8031 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/BinTools.java @@ -0,0 +1,85 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.PBKDF2; + +/* + * Source referred from Matthias Gartner's PKCS#5 implementation - + * see http://rtner.de/software/PBKDF2.html + */ + +class BinTools +{ + public static final String hex = "0123456789ABCDEF"; + + public static String bin2hex(final byte[] b) + { + if (b == null) + { + return ""; + } + StringBuffer sb = new StringBuffer(2 * b.length); + for (int i = 0; i < b.length; i++) + { + int v = (256 + b[i]) % 256; + sb.append(hex.charAt((v / 16) & 15)); + sb.append(hex.charAt((v % 16) & 15)); + } + return sb.toString(); + } + + public static byte[] hex2bin(final String s) + { + String m = s; + if (s == null) + { + // Allow empty input string. + m = ""; + } + else if (s.length() % 2 != 0) + { + // Assume leading zero for odd string length + m = "0" + s; + } + byte r[] = new byte[m.length() / 2]; + for (int i = 0, n = 0; i < m.length(); n++) + { + char h = m.charAt(i++); + char l = m.charAt(i++); + r[n] = (byte) (hex2bin(h) * 16 + hex2bin(l)); + } + return r; + } + + public static int hex2bin(char c) + { + if (c >= '0' && c <= '9') + { + return (c - '0'); + } + if (c >= 'A' && c <= 'F') + { + return (c - 'A' + 10); + } + if (c >= 'a' && c <= 'f') + { + return (c - 'a' + 10); + } + throw new IllegalArgumentException( + "Input string may only contain hex digits, but found '" + c + + "'"); + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.java b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.java new file mode 100644 index 00000000..2bd9f726 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.java @@ -0,0 +1,116 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.PBKDF2; + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +/* + * Source referred from Matthias Gartner's PKCS#5 implementation - + * see http://rtner.de/software/PBKDF2.html + */ + +public class MacBasedPRF implements PRF +{ + protected Mac mac; + + protected int hLen; + + protected String macAlgorithm; + + public MacBasedPRF(String macAlgorithm) + { + this.macAlgorithm = macAlgorithm; + try + { + mac = Mac.getInstance(macAlgorithm); + hLen = mac.getMacLength(); + } + catch (NoSuchAlgorithmException e) + { + throw new RuntimeException(e); + } + } + + public MacBasedPRF(String macAlgorithm, String provider) + { + this.macAlgorithm = macAlgorithm; + try + { + mac = Mac.getInstance(macAlgorithm, provider); + hLen = mac.getMacLength(); + } + catch (NoSuchAlgorithmException e) + { + throw new RuntimeException(e); + } + catch (NoSuchProviderException e) + { + throw new RuntimeException(e); + } + } + + public byte[] doFinal(byte[] M) + { + byte[] r = mac.doFinal(M); + return r; + } + + public byte[] doFinal() { + byte[] r = mac.doFinal(); + return r; + } + + public int getHLen() + { + return hLen; + } + + public void init(byte[] P) + { + try + { + mac.init(new SecretKeySpec(P, macAlgorithm)); + } + catch (InvalidKeyException e) + { + throw new RuntimeException(e); + } + } + + public void update(byte[] U) { + + try { + mac.update(U); + } catch (IllegalStateException e) { + throw new RuntimeException(e); + } + + } + + public void update (byte[] U, int start, int len) { + try { + mac.update(U, start, len); + } catch (IllegalStateException e) { + throw new RuntimeException(e); + } + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.java b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.java new file mode 100644 index 00000000..92b59f9b --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Engine.java @@ -0,0 +1,198 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.PBKDF2; + +import net.lingala.zip4j.util.Raw; + +/* + * Source referred from Matthias Gartner's PKCS#5 implementation - + * see http://rtner.de/software/PBKDF2.html + */ + +public class PBKDF2Engine +{ + protected PBKDF2Parameters parameters; + + protected PRF prf; + + public PBKDF2Engine() + { + this.parameters = null; + prf = null; + } + + public PBKDF2Engine(PBKDF2Parameters parameters) + { + this.parameters = parameters; + prf = null; + } + + public PBKDF2Engine(PBKDF2Parameters parameters, PRF prf) + { + this.parameters = parameters; + this.prf = prf; + } + + public byte[] deriveKey(char[] inputPassword) + { + return deriveKey(inputPassword, 0); + } + + public byte[] deriveKey(char[] inputPassword, int dkLen) + { + byte[] r = null; + byte P[] = null; + if (inputPassword == null) + { + throw new NullPointerException(); + } + + P = Raw.convertCharArrayToByteArray(inputPassword); + + assertPRF(P); + if (dkLen == 0) + { + dkLen = prf.getHLen(); + } + r = PBKDF2(prf, parameters.getSalt(), parameters.getIterationCount(), + dkLen); + return r; + } + + public boolean verifyKey(char[] inputPassword) + { + byte[] referenceKey = getParameters().getDerivedKey(); + if (referenceKey == null || referenceKey.length == 0) + { + return false; + } + byte[] inputKey = deriveKey(inputPassword, referenceKey.length); + + if (inputKey == null || inputKey.length != referenceKey.length) + { + return false; + } + for (int i = 0; i < inputKey.length; i++) + { + if (inputKey[i] != referenceKey[i]) + { + return false; + } + } + return true; + } + + protected void assertPRF(byte[] P) + { + if (prf == null) + { + prf = new MacBasedPRF(parameters.getHashAlgorithm()); + } + prf.init(P); + } + + public PRF getPseudoRandomFunction() + { + return prf; + } + + protected byte[] PBKDF2(PRF prf, byte[] S, int c, int dkLen) + { + if (S == null) + { + S = new byte[0]; + } + int hLen = prf.getHLen(); + int l = ceil(dkLen, hLen); + int r = dkLen - (l - 1) * hLen; + byte T[] = new byte[l * hLen]; + int ti_offset = 0; + for (int i = 1; i <= l; i++) + { + _F(T, ti_offset, prf, S, c, i); + ti_offset += hLen; + } + if (r < hLen) + { + // Incomplete last block + byte DK[] = new byte[dkLen]; + System.arraycopy(T, 0, DK, 0, dkLen); + return DK; + } + return T; + } + + protected int ceil(int a, int b) + { + int m = 0; + if (a % b > 0) + { + m = 1; + } + return a / b + m; + } + + protected void _F(byte[] dest, int offset, PRF prf, byte[] S, int c, + int blockIndex) + { + int hLen = prf.getHLen(); + byte U_r[] = new byte[hLen]; + + // U0 = S || INT (i); + byte U_i[] = new byte[S.length + 4]; + System.arraycopy(S, 0, U_i, 0, S.length); + INT(U_i, S.length, blockIndex); + + for (int i = 0; i < c; i++) + { + U_i = prf.doFinal(U_i); + xor(U_r, U_i); + } + System.arraycopy(U_r, 0, dest, offset, hLen); + } + + protected void xor(byte[] dest, byte[] src) + { + for (int i = 0; i < dest.length; i++) + { + dest[i] ^= src[i]; + } + } + + protected void INT(byte[] dest, int offset, int i) + { + dest[offset + 0] = (byte) (i / (256 * 256 * 256)); + dest[offset + 1] = (byte) (i / (256 * 256)); + dest[offset + 2] = (byte) (i / (256)); + dest[offset + 3] = (byte) (i); + } + + public PBKDF2Parameters getParameters() + { + return parameters; + } + + public void setParameters(PBKDF2Parameters parameters) + { + this.parameters = parameters; + } + + public void setPseudoRandomFunction(PRF prf) + { + this.prf = prf; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2HexFormatter.java b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2HexFormatter.java new file mode 100644 index 00000000..d0b287a3 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2HexFormatter.java @@ -0,0 +1,56 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.PBKDF2; + +/* + * Source referred from Matthias Gartner's PKCS#5 implementation - + * see http://rtner.de/software/PBKDF2.html + */ + +class PBKDF2HexFormatter +{ + public boolean fromString(PBKDF2Parameters p, String s) + { + if (p == null || s == null) + { + return true; + } + + String[] p123 = s.split(":"); + if (p123 == null || p123.length != 3) + { + return true; + } + + byte salt[] = BinTools.hex2bin(p123[0]); + int iterationCount = Integer.parseInt(p123[1]); + byte bDK[] = BinTools.hex2bin(p123[2]); + + p.setSalt(salt); + p.setIterationCount(iterationCount); + p.setDerivedKey(bDK); + return false; + } + + public String toString(PBKDF2Parameters p) + { + String s = BinTools.bin2hex(p.getSalt()) + ":" + + String.valueOf(p.getIterationCount()) + ":" + + BinTools.bin2hex(p.getDerivedKey()); + return s; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.java b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.java new file mode 100644 index 00000000..d6ce8ee5 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PBKDF2Parameters.java @@ -0,0 +1,112 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.PBKDF2; +/* + * Source referred from Matthias Gartner's PKCS#5 implementation - + * see http://rtner.de/software/PBKDF2.html + */ +public class PBKDF2Parameters +{ + protected byte[] salt; + + protected int iterationCount; + + protected String hashAlgorithm; + + protected String hashCharset; + + protected byte[] derivedKey; + + public PBKDF2Parameters() + { + this.hashAlgorithm = null; + this.hashCharset = "UTF-8"; + this.salt = null; + this.iterationCount = 1000; + this.derivedKey = null; + } + + public PBKDF2Parameters(String hashAlgorithm, String hashCharset, + byte[] salt, int iterationCount) + { + this.hashAlgorithm = hashAlgorithm; + this.hashCharset = hashCharset; + this.salt = salt; + this.iterationCount = iterationCount; + this.derivedKey = null; + } + + public PBKDF2Parameters(String hashAlgorithm, String hashCharset, + byte[] salt, int iterationCount, byte[] derivedKey) + { + this.hashAlgorithm = hashAlgorithm; + this.hashCharset = hashCharset; + this.salt = salt; + this.iterationCount = iterationCount; + this.derivedKey = derivedKey; + } + + public int getIterationCount() + { + return iterationCount; + } + + public void setIterationCount(int iterationCount) + { + this.iterationCount = iterationCount; + } + + public byte[] getSalt() + { + return salt; + } + + public void setSalt(byte[] salt) + { + this.salt = salt; + } + + public byte[] getDerivedKey() + { + return derivedKey; + } + + public void setDerivedKey(byte[] derivedKey) + { + this.derivedKey = derivedKey; + } + + public String getHashAlgorithm() + { + return hashAlgorithm; + } + + public void setHashAlgorithm(String hashAlgorithm) + { + this.hashAlgorithm = hashAlgorithm; + } + + public String getHashCharset() + { + return hashCharset; + } + + public void setHashCharset(String hashCharset) + { + this.hashCharset = hashCharset; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PRF.java b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PRF.java new file mode 100644 index 00000000..d26ab555 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/PBKDF2/PRF.java @@ -0,0 +1,31 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.PBKDF2; + +/* + * Source referred from Matthias Gartner's PKCS#5 implementation - + * see http://rtner.de/software/PBKDF2.html + */ + +interface PRF +{ + public void init(byte[] P); + + public byte[] doFinal(byte[] M); + + public int getHLen(); +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/StandardDecrypter.java b/lib/zip4j/src/net/lingala/zip4j/crypto/StandardDecrypter.java new file mode 100644 index 00000000..b519a9e3 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/StandardDecrypter.java @@ -0,0 +1,97 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto; + +import net.lingala.zip4j.crypto.engine.ZipCryptoEngine; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.exception.ZipExceptionConstants; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.util.InternalZipConstants; + +public class StandardDecrypter implements IDecrypter { + + private FileHeader fileHeader; + private byte[] crc = new byte[4]; + private ZipCryptoEngine zipCryptoEngine; + + public StandardDecrypter(FileHeader fileHeader, byte[] headerBytes) throws ZipException{ + if (fileHeader == null) { + throw new ZipException("one of more of the input parameters were null in StandardDecryptor"); + } + + this.fileHeader = fileHeader; + this.zipCryptoEngine = new ZipCryptoEngine(); + init(headerBytes); + } + + public int decryptData(byte[] buff) throws ZipException { + return decryptData(buff, 0, buff.length); + } + + public int decryptData(byte[] buff, int start, int len) throws ZipException { + if (start < 0 || len < 0) { + throw new ZipException("one of the input parameters were null in standard decrpyt data"); + } + + try { + for (int i = start; i < start + len; i++) { + int val = buff[i] & 0xff; + val = (val ^ zipCryptoEngine.decryptByte()) & 0xff; + zipCryptoEngine.updateKeys((byte) val); + buff[i] = (byte)val; + } + return len; + } catch (Exception e) { + throw new ZipException(e); + } + } + + public void init(byte[] headerBytes) throws ZipException { + byte[] crcBuff = fileHeader.getCrcBuff(); + crc[3] = (byte) (crcBuff[3] & 0xFF); + crc[2] = (byte) ((crcBuff[3] >> 8) & 0xFF); + crc[1] = (byte) ((crcBuff[3] >> 16) & 0xFF); + crc[0] = (byte) ((crcBuff[3] >> 24) & 0xFF); + + if(crc[2] > 0 || crc[1] > 0 || crc[0] > 0) + throw new IllegalStateException("Invalid CRC in File Header"); + + if (fileHeader.getPassword() == null || fileHeader.getPassword().length <= 0) { + throw new ZipException("Wrong password!", ZipExceptionConstants.WRONG_PASSWORD); + } + + zipCryptoEngine.initKeys(fileHeader.getPassword()); + + try { + int result = headerBytes[0]; + for (int i = 0; i < InternalZipConstants.STD_DEC_HDR_SIZE; i++) { +// Commented this as this check cannot always be trusted +// New functionality: If there is an error in extracting a password protected file, +// "Wrong Password?" text is appended to the exception message +// if(i+1 == InternalZipConstants.STD_DEC_HDR_SIZE && ((byte)(result ^ zipCryptoEngine.decryptByte()) != crc[3]) && !isSplit) +// throw new ZipException("Wrong password!", ZipExceptionConstants.WRONG_PASSWORD); + + zipCryptoEngine.updateKeys((byte) (result ^ zipCryptoEngine.decryptByte())); + if (i+1 != InternalZipConstants.STD_DEC_HDR_SIZE) + result = headerBytes[i+1]; + } + } catch (Exception e) { + throw new ZipException(e); + } + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/StandardEncrypter.java b/lib/zip4j/src/net/lingala/zip4j/crypto/StandardEncrypter.java new file mode 100644 index 00000000..ce94411f --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/StandardEncrypter.java @@ -0,0 +1,133 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto; + +import java.util.Random; + +import net.lingala.zip4j.crypto.engine.ZipCryptoEngine; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.util.InternalZipConstants; + +public class StandardEncrypter implements IEncrypter { + + private ZipCryptoEngine zipCryptoEngine; + private byte[] headerBytes; + + public StandardEncrypter(char[] password, int crc) throws ZipException { + if (password == null || password.length <= 0) { + throw new ZipException("input password is null or empty in standard encrpyter constructor"); + } + + this.zipCryptoEngine = new ZipCryptoEngine(); + + this.headerBytes = new byte[InternalZipConstants.STD_DEC_HDR_SIZE]; + init(password, crc); + } + + private void init(char[] password, int crc) throws ZipException { + if (password == null || password.length <= 0) { + throw new ZipException("input password is null or empty, cannot initialize standard encrypter"); + } + zipCryptoEngine.initKeys(password); + headerBytes = generateRandomBytes(InternalZipConstants.STD_DEC_HDR_SIZE); + // Initialize again since the generated bytes were encrypted. + zipCryptoEngine.initKeys(password); + + headerBytes[InternalZipConstants.STD_DEC_HDR_SIZE - 1] = (byte)((crc >>> 24)); + headerBytes[InternalZipConstants.STD_DEC_HDR_SIZE - 2] = (byte)((crc >>> 16)); + + if (headerBytes.length < InternalZipConstants.STD_DEC_HDR_SIZE) { + throw new ZipException("invalid header bytes generated, cannot perform standard encryption"); + } + + encryptData(headerBytes); + } + + public int encryptData(byte[] buff) throws ZipException { + if (buff == null) { + throw new NullPointerException(); + } + return encryptData(buff, 0, buff.length); + } + + public int encryptData(byte[] buff, int start, int len) throws ZipException { + + if (len < 0) { + throw new ZipException("invalid length specified to decrpyt data"); + } + + try { + for (int i = start; i < start + len; i++) { + buff[i] = encryptByte(buff[i]); + } + return len; + } catch (Exception e) { + throw new ZipException(e); + } + } + + protected byte encryptByte(byte val) { + byte temp_val = (byte) (val ^ zipCryptoEngine.decryptByte() & 0xff); + zipCryptoEngine.updateKeys(val); + return temp_val; + } + + protected byte[] generateRandomBytes(int size) throws ZipException { + + if (size <= 0) { + throw new ZipException("size is either 0 or less than 0, cannot generate header for standard encryptor"); + } + + byte[] buff = new byte[size]; + + Random rand = new Random(); + + for (int i = 0; i < buff.length; i ++) { + // Encrypted to get less predictability for poorly implemented + // rand functions. + buff[i] = encryptByte((byte) rand.nextInt(256)); + } + +// buff[0] = (byte)87; +// buff[1] = (byte)176; +// buff[2] = (byte)-49; +// buff[3] = (byte)-43; +// buff[4] = (byte)93; +// buff[5] = (byte)-204; +// buff[6] = (byte)-105; +// buff[7] = (byte)213; +// buff[8] = (byte)-80; +// buff[9] = (byte)-8; +// buff[10] = (byte)21; +// buff[11] = (byte)242; + +// for( int j=0; j<2; j++ ) { +// Random rand = new Random(); +// int i = rand.nextInt(); +// buff[0+j*4] = (byte)(i>>24); +// buff[1+j*4] = (byte)(i>>16); +// buff[2+j*4] = (byte)(i>>8); +// buff[3+j*4] = (byte)i; +// } + return buff; + } + + public byte[] getHeaderBytes() { + return headerBytes; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/engine/AESEngine.java b/lib/zip4j/src/net/lingala/zip4j/crypto/engine/AESEngine.java new file mode 100644 index 00000000..4d850df1 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/engine/AESEngine.java @@ -0,0 +1,291 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.engine; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.util.InternalZipConstants; + +/** + * Core Engine for AES Encryption + * @author Srikanth Reddy Lingala + * + */ +public class AESEngine { + + private int rounds; + private int[][] workingKey = null; + private int C0, C1, C2, C3; + + public AESEngine(byte[] key) throws ZipException { + init(key); + } + + public void init(byte[] key) throws ZipException { + workingKey = generateWorkingKey(key); + } + + private int[][] generateWorkingKey(byte[] key) throws ZipException { + int kc = key.length / 4; + int t; + + if (((kc != 4) && (kc != 6) && (kc != 8)) || ((kc * 4) != key.length)) + { + throw new ZipException("invalid key length (not 128/192/256)"); + } + + rounds = kc + 6; + int[][] W = new int[rounds+1][4]; + + t = 0; + int i = 0; + while (i < key.length) + { + W[t >> 2][t & 3] = (key[i]&0xff) | ((key[i+1]&0xff) << 8) | ((key[i+2]&0xff) << 16) | (key[i+3] << 24); + i+=4; + t++; + } + + int k = (rounds + 1) << 2; + for (i = kc; (i < k); i++) + { + int temp = W[(i-1)>>2][(i-1)&3]; + if ((i % kc) == 0) + { + temp = subWord(shift(temp, 8)) ^ rcon[(i / kc)-1]; + } + else if ((kc > 6) && ((i % kc) == 4)) + { + temp = subWord(temp); + } + + W[i>>2][i&3] = W[(i - kc)>>2][(i-kc)&3] ^ temp; + } + return W; + } + + public int processBlock(byte[] in, byte[] out) throws ZipException { + return processBlock(in, 0, out, 0); + } + + public int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws ZipException { + if (workingKey == null) + { + throw new ZipException("AES engine not initialised"); + } + + if ((inOff + (32 / 2)) > in.length) + { + throw new ZipException("input buffer too short"); + } + + if ((outOff + (32 / 2)) > out.length) + { + throw new ZipException("output buffer too short"); + } + + stateIn(in, inOff); + encryptBlock(workingKey); + stateOut(out, outOff); + + return InternalZipConstants.AES_BLOCK_SIZE; + } + + private final void stateIn(byte[] bytes, int off) { + int index = off; + + C0 = (bytes[index++] & 0xff); + C0 |= (bytes[index++] & 0xff) << 8; + C0 |= (bytes[index++] & 0xff) << 16; + C0 |= bytes[index++] << 24; + + C1 = (bytes[index++] & 0xff); + C1 |= (bytes[index++] & 0xff) << 8; + C1 |= (bytes[index++] & 0xff) << 16; + C1 |= bytes[index++] << 24; + + C2 = (bytes[index++] & 0xff); + C2 |= (bytes[index++] & 0xff) << 8; + C2 |= (bytes[index++] & 0xff) << 16; + C2 |= bytes[index++] << 24; + + C3 = (bytes[index++] & 0xff); + C3 |= (bytes[index++] & 0xff) << 8; + C3 |= (bytes[index++] & 0xff) << 16; + C3 |= bytes[index++] << 24; + } + + private final void stateOut(byte[] bytes, int off) { + int index = off; + + bytes[index++] = (byte)C0; + bytes[index++] = (byte)(C0 >> 8); + bytes[index++] = (byte)(C0 >> 16); + bytes[index++] = (byte)(C0 >> 24); + + bytes[index++] = (byte)C1; + bytes[index++] = (byte)(C1 >> 8); + bytes[index++] = (byte)(C1 >> 16); + bytes[index++] = (byte)(C1 >> 24); + + bytes[index++] = (byte)C2; + bytes[index++] = (byte)(C2 >> 8); + bytes[index++] = (byte)(C2 >> 16); + bytes[index++] = (byte)(C2 >> 24); + + bytes[index++] = (byte)C3; + bytes[index++] = (byte)(C3 >> 8); + bytes[index++] = (byte)(C3 >> 16); + bytes[index++] = (byte)(C3 >> 24); + } + + private final void encryptBlock(int[][] KW) { + int r, r0, r1, r2, r3; + + C0 ^= KW[0][0]; + C1 ^= KW[0][1]; + C2 ^= KW[0][2]; + C3 ^= KW[0][3]; + + r = 1; + + while (r < rounds - 1) + { + r0 = T0[C0&255] ^ shift(T0[(C1>>8)&255], 24) ^ shift(T0[(C2>>16)&255],16) ^ shift(T0[(C3>>24)&255],8) ^ KW[r][0]; + r1 = T0[C1&255] ^ shift(T0[(C2>>8)&255], 24) ^ shift(T0[(C3>>16)&255], 16) ^ shift(T0[(C0>>24)&255], 8) ^ KW[r][1]; + r2 = T0[C2&255] ^ shift(T0[(C3>>8)&255], 24) ^ shift(T0[(C0>>16)&255], 16) ^ shift(T0[(C1>>24)&255], 8) ^ KW[r][2]; + r3 = T0[C3&255] ^ shift(T0[(C0>>8)&255], 24) ^ shift(T0[(C1>>16)&255], 16) ^ shift(T0[(C2>>24)&255], 8) ^ KW[r++][3]; + C0 = T0[r0&255] ^ shift(T0[(r1>>8)&255], 24) ^ shift(T0[(r2>>16)&255], 16) ^ shift(T0[(r3>>24)&255], 8) ^ KW[r][0]; + C1 = T0[r1&255] ^ shift(T0[(r2>>8)&255], 24) ^ shift(T0[(r3>>16)&255], 16) ^ shift(T0[(r0>>24)&255], 8) ^ KW[r][1]; + C2 = T0[r2&255] ^ shift(T0[(r3>>8)&255], 24) ^ shift(T0[(r0>>16)&255], 16) ^ shift(T0[(r1>>24)&255], 8) ^ KW[r][2]; + C3 = T0[r3&255] ^ shift(T0[(r0>>8)&255], 24) ^ shift(T0[(r1>>16)&255], 16) ^ shift(T0[(r2>>24)&255], 8) ^ KW[r++][3]; + } + + r0 = T0[C0&255] ^ shift(T0[(C1>>8)&255], 24) ^ shift(T0[(C2>>16)&255], 16) ^ shift(T0[(C3>>24)&255], 8) ^ KW[r][0]; + r1 = T0[C1&255] ^ shift(T0[(C2>>8)&255], 24) ^ shift(T0[(C3>>16)&255], 16) ^ shift(T0[(C0>>24)&255], 8) ^ KW[r][1]; + r2 = T0[C2&255] ^ shift(T0[(C3>>8)&255], 24) ^ shift(T0[(C0>>16)&255], 16) ^ shift(T0[(C1>>24)&255], 8) ^ KW[r][2]; + r3 = T0[C3&255] ^ shift(T0[(C0>>8)&255], 24) ^ shift(T0[(C1>>16)&255], 16) ^ shift(T0[(C2>>24)&255], 8) ^ KW[r++][3]; + + C0 = (S[r0&255]&255) ^ ((S[(r1>>8)&255]&255)<<8) ^ ((S[(r2>>16)&255]&255)<<16) ^ (S[(r3>>24)&255]<<24) ^ KW[r][0]; + C1 = (S[r1&255]&255) ^ ((S[(r2>>8)&255]&255)<<8) ^ ((S[(r3>>16)&255]&255)<<16) ^ (S[(r0>>24)&255]<<24) ^ KW[r][1]; + C2 = (S[r2&255]&255) ^ ((S[(r3>>8)&255]&255)<<8) ^ ((S[(r0>>16)&255]&255)<<16) ^ (S[(r1>>24)&255]<<24) ^ KW[r][2]; + C3 = (S[r3&255]&255) ^ ((S[(r0>>8)&255]&255)<<8) ^ ((S[(r1>>16)&255]&255)<<16) ^ (S[(r2>>24)&255]<<24) ^ KW[r][3]; + + } + + private int shift(int r, int shift) { + return (r >>> shift) | (r << -shift); + } + + private int subWord(int x) { + return (S[x&255]&255 | ((S[(x>>8)&255]&255)<<8) | ((S[(x>>16)&255]&255)<<16) | S[(x>>24)&255]<<24); + } + + private static final byte[] S = { + (byte)99, (byte)124, (byte)119, (byte)123, (byte)242, (byte)107, (byte)111, (byte)197, + (byte)48, (byte)1, (byte)103, (byte)43, (byte)254, (byte)215, (byte)171, (byte)118, + (byte)202, (byte)130, (byte)201, (byte)125, (byte)250, (byte)89, (byte)71, (byte)240, + (byte)173, (byte)212, (byte)162, (byte)175, (byte)156, (byte)164, (byte)114, (byte)192, + (byte)183, (byte)253, (byte)147, (byte)38, (byte)54, (byte)63, (byte)247, (byte)204, + (byte)52, (byte)165, (byte)229, (byte)241, (byte)113, (byte)216, (byte)49, (byte)21, + (byte)4, (byte)199, (byte)35, (byte)195, (byte)24, (byte)150, (byte)5, (byte)154, + (byte)7, (byte)18, (byte)128, (byte)226, (byte)235, (byte)39, (byte)178, (byte)117, + (byte)9, (byte)131, (byte)44, (byte)26, (byte)27, (byte)110, (byte)90, (byte)160, + (byte)82, (byte)59, (byte)214, (byte)179, (byte)41, (byte)227, (byte)47, (byte)132, + (byte)83, (byte)209, (byte)0, (byte)237, (byte)32, (byte)252, (byte)177, (byte)91, + (byte)106, (byte)203, (byte)190, (byte)57, (byte)74, (byte)76, (byte)88, (byte)207, + (byte)208, (byte)239, (byte)170, (byte)251, (byte)67, (byte)77, (byte)51, (byte)133, + (byte)69, (byte)249, (byte)2, (byte)127, (byte)80, (byte)60, (byte)159, (byte)168, + (byte)81, (byte)163, (byte)64, (byte)143, (byte)146, (byte)157, (byte)56, (byte)245, + (byte)188, (byte)182, (byte)218, (byte)33, (byte)16, (byte)255, (byte)243, (byte)210, + (byte)205, (byte)12, (byte)19, (byte)236, (byte)95, (byte)151, (byte)68, (byte)23, + (byte)196, (byte)167, (byte)126, (byte)61, (byte)100, (byte)93, (byte)25, (byte)115, + (byte)96, (byte)129, (byte)79, (byte)220, (byte)34, (byte)42, (byte)144, (byte)136, + (byte)70, (byte)238, (byte)184, (byte)20, (byte)222, (byte)94, (byte)11, (byte)219, + (byte)224, (byte)50, (byte)58, (byte)10, (byte)73, (byte)6, (byte)36, (byte)92, + (byte)194, (byte)211, (byte)172, (byte)98, (byte)145, (byte)149, (byte)228, (byte)121, + (byte)231, (byte)200, (byte)55, (byte)109, (byte)141, (byte)213, (byte)78, (byte)169, + (byte)108, (byte)86, (byte)244, (byte)234, (byte)101, (byte)122, (byte)174, (byte)8, + (byte)186, (byte)120, (byte)37, (byte)46, (byte)28, (byte)166, (byte)180, (byte)198, + (byte)232, (byte)221, (byte)116, (byte)31, (byte)75, (byte)189, (byte)139, (byte)138, + (byte)112, (byte)62, (byte)181, (byte)102, (byte)72, (byte)3, (byte)246, (byte)14, + (byte)97, (byte)53, (byte)87, (byte)185, (byte)134, (byte)193, (byte)29, (byte)158, + (byte)225, (byte)248, (byte)152, (byte)17, (byte)105, (byte)217, (byte)142, (byte)148, + (byte)155, (byte)30, (byte)135, (byte)233, (byte)206, (byte)85, (byte)40, (byte)223, + (byte)140, (byte)161, (byte)137, (byte)13, (byte)191, (byte)230, (byte)66, (byte)104, + (byte)65, (byte)153, (byte)45, (byte)15, (byte)176, (byte)84, (byte)187, (byte)22, + }; + + private static final int[] rcon = { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, + 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 }; + + private static final int[] T0 = + { + 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0x0df2f2ff, + 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591, 0x50303060, 0x03010102, + 0xa96767ce, 0x7d2b2b56, 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, + 0x9a7676ec, 0x45caca8f, 0x9d82821f, 0x40c9c989, 0x877d7dfa, + 0x15fafaef, 0xeb5959b2, 0xc947478e, 0x0bf0f0fb, 0xecadad41, + 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45, 0xbf9c9c23, 0xf7a4a453, + 0x967272e4, 0x5bc0c09b, 0xc2b7b775, 0x1cfdfde1, 0xae93933d, + 0x6a26264c, 0x5a36366c, 0x413f3f7e, 0x02f7f7f5, 0x4fcccc83, + 0x5c343468, 0xf4a5a551, 0x34e5e5d1, 0x08f1f1f9, 0x937171e2, + 0x73d8d8ab, 0x53313162, 0x3f15152a, 0x0c040408, 0x52c7c795, + 0x65232346, 0x5ec3c39d, 0x28181830, 0xa1969637, 0x0f05050a, + 0xb59a9a2f, 0x0907070e, 0x36121224, 0x9b80801b, 0x3de2e2df, + 0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea, 0x1b090912, + 0x9e83831d, 0x742c2c58, 0x2e1a1a34, 0x2d1b1b36, 0xb26e6edc, + 0xee5a5ab4, 0xfba0a05b, 0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, + 0xceb3b37d, 0x7b292952, 0x3ee3e3dd, 0x712f2f5e, 0x97848413, + 0xf55353a6, 0x68d1d1b9, 0x00000000, 0x2cededc1, 0x60202040, + 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6, 0xbe6a6ad4, 0x46cbcb8d, + 0xd9bebe67, 0x4b393972, 0xde4a4a94, 0xd44c4c98, 0xe85858b0, + 0x4acfcf85, 0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed, + 0xc5434386, 0xd74d4d9a, 0x55333366, 0x94858511, 0xcf45458a, + 0x10f9f9e9, 0x06020204, 0x817f7ffe, 0xf05050a0, 0x443c3c78, + 0xba9f9f25, 0xe3a8a84b, 0xf35151a2, 0xfea3a35d, 0xc0404080, + 0x8a8f8f05, 0xad92923f, 0xbc9d9d21, 0x48383870, 0x04f5f5f1, + 0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142, 0x30101020, + 0x1affffe5, 0x0ef3f3fd, 0x6dd2d2bf, 0x4ccdcd81, 0x140c0c18, + 0x35131326, 0x2fececc3, 0xe15f5fbe, 0xa2979735, 0xcc444488, + 0x3917172e, 0x57c4c493, 0xf2a7a755, 0x827e7efc, 0x473d3d7a, + 0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6, 0xa06060c0, + 0x98818119, 0xd14f4f9e, 0x7fdcdca3, 0x66222244, 0x7e2a2a54, + 0xab90903b, 0x8388880b, 0xca46468c, 0x29eeeec7, 0xd3b8b86b, + 0x3c141428, 0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad, + 0x3be0e0db, 0x56323264, 0x4e3a3a74, 0x1e0a0a14, 0xdb494992, + 0x0a06060c, 0x6c242448, 0xe45c5cb8, 0x5dc2c29f, 0x6ed3d3bd, + 0xefacac43, 0xa66262c4, 0xa8919139, 0xa4959531, 0x37e4e4d3, + 0x8b7979f2, 0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda, + 0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949, 0xb46c6cd8, + 0xfa5656ac, 0x07f4f4f3, 0x25eaeacf, 0xaf6565ca, 0x8e7a7af4, + 0xe9aeae47, 0x18080810, 0xd5baba6f, 0x887878f0, 0x6f25254a, + 0x722e2e5c, 0x241c1c38, 0xf1a6a657, 0xc7b4b473, 0x51c6c697, + 0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e, 0xdd4b4b96, + 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f, 0x907070e0, 0x423e3e7c, + 0xc4b5b571, 0xaa6666cc, 0xd8484890, 0x05030306, 0x01f6f6f7, + 0x120e0e1c, 0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969, + 0x91868617, 0x58c1c199, 0x271d1d3a, 0xb99e9e27, 0x38e1e1d9, + 0x13f8f8eb, 0xb398982b, 0x33111122, 0xbb6969d2, 0x70d9d9a9, + 0x898e8e07, 0xa7949433, 0xb69b9b2d, 0x221e1e3c, 0x92878715, + 0x20e9e9c9, 0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5, + 0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a, 0xdabfbf65, + 0x31e6e6d7, 0xc6424284, 0xb86868d0, 0xc3414182, 0xb0999929, + 0x772d2d5a, 0x110f0f1e, 0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, + 0x3a16162c}; + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.java b/lib/zip4j/src/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.java new file mode 100644 index 00000000..5b741e01 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/crypto/engine/ZipCryptoEngine.java @@ -0,0 +1,65 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.crypto.engine; + +public class ZipCryptoEngine { + + private final int keys[] = new int[3]; + private static final int[] CRC_TABLE = new int[256]; + + static { + for (int i = 0; i < 256; i++) { + int r = i; + for (int j = 0; j < 8; j++) { + if ((r & 1) == 1) { + r = (r >>> 1) ^ 0xedb88320; + } else { + r >>>= 1; + } + } + CRC_TABLE[i] = r; + } + } + + public ZipCryptoEngine() { + } + + public void initKeys(char[] password) { + keys[0] = 305419896; + keys[1] = 591751049; + keys[2] = 878082192; + for (int i = 0; i < password.length; i++) { + updateKeys((byte) (password[i] & 0xff)); + } + } + + public void updateKeys(byte charAt) { + keys[0] = crc32(keys[0], charAt); + keys[1] += keys[0] & 0xff; + keys[1] = keys[1] * 134775813 + 1; + keys[2] = crc32(keys[2], (byte) (keys[1] >> 24)); + } + + private int crc32(int oldCrc, byte charAt) { + return ((oldCrc >>> 8) ^ CRC_TABLE[(oldCrc ^ charAt) & 0xff]); + } + + public byte decryptByte() { + int temp = keys[2] | 2; + return (byte) ((temp * (temp ^ 1)) >>> 8); + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/exception/ZipException.java b/lib/zip4j/src/net/lingala/zip4j/exception/ZipException.java new file mode 100644 index 00000000..f1052228 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/exception/ZipException.java @@ -0,0 +1,59 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.exception; + +public class ZipException extends Exception { + + private static final long serialVersionUID = 1L; + + private int code = -1; + + public ZipException() { + } + + public ZipException(String msg) { + super(msg); + } + + public ZipException(String message, Throwable cause) { + super(message, cause); + } + + public ZipException(String msg, int code) { + super(msg); + this.code = code; + } + + public ZipException(String message, Throwable cause, int code) { + super(message, cause); + this.code = code; + } + + public ZipException(Throwable cause) { + super(cause); + } + + public ZipException(Throwable cause, int code) { + super(cause); + this.code = code; + } + + public int getCode() { + return code; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/exception/ZipExceptionConstants.java b/lib/zip4j/src/net/lingala/zip4j/exception/ZipExceptionConstants.java new file mode 100644 index 00000000..0bca6679 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/exception/ZipExceptionConstants.java @@ -0,0 +1,31 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.exception; + +public interface ZipExceptionConstants { + + public static int inputZipParamIsNull = 0001; + + public static int constuctorFileNotFoundException = 0002; + + public static int randomAccessFileNull = 0003; + + public static int notZipFile = 0004; + + public static int WRONG_PASSWORD = 0005; + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/BaseInputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/BaseInputStream.java new file mode 100644 index 00000000..275e78e6 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/BaseInputStream.java @@ -0,0 +1,25 @@ +package net.lingala.zip4j.io; + +import java.io.IOException; +import java.io.InputStream; + +import net.lingala.zip4j.unzip.UnzipEngine; + +public abstract class BaseInputStream extends InputStream { + + public int read() throws IOException { + return 0; + } + + public void seek(long pos) throws IOException { + } + + public int available() throws IOException { + return 0; + } + + public UnzipEngine getUnzipEngine() { + return null; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/BaseOutputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/BaseOutputStream.java new file mode 100644 index 00000000..c9b32bca --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/BaseOutputStream.java @@ -0,0 +1,27 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.io; + +import java.io.IOException; +import java.io.OutputStream; + +public abstract class BaseOutputStream extends OutputStream { + + public void write(int b) throws IOException { + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/CipherOutputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/CipherOutputStream.java new file mode 100644 index 00000000..06b1b4fe --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/CipherOutputStream.java @@ -0,0 +1,570 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.io; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.zip.CRC32; + +import net.lingala.zip4j.core.HeaderWriter; +import net.lingala.zip4j.crypto.AESEncrpyter; +import net.lingala.zip4j.crypto.IEncrypter; +import net.lingala.zip4j.crypto.StandardEncrypter; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.model.AESExtraDataRecord; +import net.lingala.zip4j.model.CentralDirectory; +import net.lingala.zip4j.model.EndCentralDirRecord; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.LocalFileHeader; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.model.ZipParameters; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Raw; +import net.lingala.zip4j.util.Zip4jConstants; +import net.lingala.zip4j.util.Zip4jUtil; + +public class CipherOutputStream extends BaseOutputStream { + + protected OutputStream outputStream; + private File sourceFile; + protected FileHeader fileHeader; + protected LocalFileHeader localFileHeader; + private IEncrypter encrypter; + protected ZipParameters zipParameters; + protected ZipModel zipModel; + private long totalBytesWritten; + protected CRC32 crc; + private long bytesWrittenForThisFile; + private byte[] pendingBuffer; + private int pendingBufferLength; + private long totalBytesRead; + + public CipherOutputStream(OutputStream outputStream, ZipModel zipModel) { + this.outputStream = outputStream; + initZipModel(zipModel); + crc = new CRC32(); + this.totalBytesWritten = 0; + this.bytesWrittenForThisFile = 0; + this.pendingBuffer = new byte[InternalZipConstants.AES_BLOCK_SIZE]; + this.pendingBufferLength = 0; + this.totalBytesRead = 0; + } + + public void putNextEntry(File file, ZipParameters zipParameters) throws ZipException { + if (!zipParameters.isSourceExternalStream() && file == null) { + throw new ZipException("input file is null"); + } + + if (!zipParameters.isSourceExternalStream() && !Zip4jUtil.checkFileExists(file)) { + throw new ZipException("input file does not exist"); + } + + try { + sourceFile = file; + + this.zipParameters = (ZipParameters)zipParameters.clone(); + + if (!zipParameters.isSourceExternalStream()) { + if (sourceFile.isDirectory()) { + this.zipParameters.setEncryptFiles(false); + this.zipParameters.setEncryptionMethod(-1); + this.zipParameters.setCompressionMethod(Zip4jConstants.COMP_STORE); + } + } else { + if (!Zip4jUtil.isStringNotNullAndNotEmpty(this.zipParameters.getFileNameInZip())) { + throw new ZipException("file name is empty for external stream"); + } + if (this.zipParameters.getFileNameInZip().endsWith("/") || + this.zipParameters.getFileNameInZip().endsWith("\\")) { + this.zipParameters.setEncryptFiles(false); + this.zipParameters.setEncryptionMethod(-1); + this.zipParameters.setCompressionMethod(Zip4jConstants.COMP_STORE); + } + } + + createFileHeader(); + createLocalFileHeader(); + + if (zipModel.isSplitArchive()) { + if (zipModel.getCentralDirectory() == null || + zipModel.getCentralDirectory().getFileHeaders() == null || + zipModel.getCentralDirectory().getFileHeaders().size() == 0) { + byte[] intByte = new byte[4]; + Raw.writeIntLittleEndian(intByte, 0, (int)InternalZipConstants.SPLITSIG); + outputStream.write(intByte); + totalBytesWritten += 4; + } + } + + if (this.outputStream instanceof SplitOutputStream) { + if (totalBytesWritten == 4) { + fileHeader.setOffsetLocalHeader(4); + } else { + fileHeader.setOffsetLocalHeader(((SplitOutputStream)outputStream).getFilePointer()); + } + } else { + if (totalBytesWritten == 4) { + fileHeader.setOffsetLocalHeader(4); + } else { + fileHeader.setOffsetLocalHeader(totalBytesWritten); + } + } + + HeaderWriter headerWriter = new HeaderWriter(); + totalBytesWritten += headerWriter.writeLocalFileHeader(zipModel, localFileHeader, outputStream); + + if (this.zipParameters.isEncryptFiles()) { + initEncrypter(); + if (encrypter != null) { + if (zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + byte[] headerBytes = ((StandardEncrypter)encrypter).getHeaderBytes(); + outputStream.write(headerBytes); + totalBytesWritten += headerBytes.length; + bytesWrittenForThisFile += headerBytes.length; + } else if (zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + byte[] saltBytes = ((AESEncrpyter)encrypter).getSaltBytes(); + byte[] passwordVerifier = ((AESEncrpyter)encrypter).getDerivedPasswordVerifier(); + outputStream.write(saltBytes); + outputStream.write(passwordVerifier); + totalBytesWritten += saltBytes.length + passwordVerifier.length; + bytesWrittenForThisFile += saltBytes.length + passwordVerifier.length; + } + } + } + + crc.reset(); + } catch (CloneNotSupportedException e) { + throw new ZipException(e); + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void initEncrypter() throws ZipException { + if (!zipParameters.isEncryptFiles()) { + encrypter = null; + return; + } + + switch (zipParameters.getEncryptionMethod()) { + case Zip4jConstants.ENC_METHOD_STANDARD: + // Since we do not know the crc here, we use the modification time for encrypting. + encrypter = new StandardEncrypter(zipParameters.getPassword(), (localFileHeader.getLastModFileTime() & 0x0000ffff) << 16); + break; + case Zip4jConstants.ENC_METHOD_AES: + encrypter = new AESEncrpyter(zipParameters.getPassword(), zipParameters.getAesKeyStrength()); + break; + default: + throw new ZipException("invalid encprytion method"); + } + } + + private void initZipModel(ZipModel zipModel) { + if (zipModel == null) { + this.zipModel = new ZipModel(); + } else { + this.zipModel = zipModel; + } + + if (this.zipModel.getEndCentralDirRecord() == null) + this.zipModel.setEndCentralDirRecord(new EndCentralDirRecord()); + + if (this.zipModel.getCentralDirectory() == null) + this.zipModel.setCentralDirectory(new CentralDirectory()); + + if (this.zipModel.getCentralDirectory().getFileHeaders() == null) + this.zipModel.getCentralDirectory().setFileHeaders(new ArrayList()); + + if (this.zipModel.getLocalFileHeaderList() == null) + this.zipModel.setLocalFileHeaderList(new ArrayList()); + + if (this.outputStream instanceof SplitOutputStream) { + if (((SplitOutputStream)outputStream).isSplitZipFile()) { + this.zipModel.setSplitArchive(true); + this.zipModel.setSplitLength(((SplitOutputStream)outputStream).getSplitLength()); + } + } + + this.zipModel.getEndCentralDirRecord().setSignature(InternalZipConstants.ENDSIG); + } + + public void write(int bval) throws IOException { + byte[] b = new byte[1]; + b[0] = (byte) bval; + write(b, 0, 1); + } + + public void write(byte[] b) throws IOException { + if (b == null) + throw new NullPointerException(); + + if (b.length == 0) return; + + write(b, 0, b.length); + } + + public void write(byte[] b, int off, int len) throws IOException { + if (len == 0) return; + + if (zipParameters.isEncryptFiles() && + zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + if (pendingBufferLength != 0) { + if (len >= (InternalZipConstants.AES_BLOCK_SIZE - pendingBufferLength)) { + System.arraycopy(b, off, pendingBuffer, pendingBufferLength, + (InternalZipConstants.AES_BLOCK_SIZE - pendingBufferLength)); + encryptAndWrite(pendingBuffer, 0, pendingBuffer.length); + off = (InternalZipConstants.AES_BLOCK_SIZE - pendingBufferLength); + len = len - off; + pendingBufferLength = 0; + } else { + System.arraycopy(b, off, pendingBuffer, pendingBufferLength, + len); + pendingBufferLength += len; + return; + } + } + if (len != 0 && len % 16 != 0) { + System.arraycopy(b, (len + off) - (len % 16), pendingBuffer, 0, len % 16); + pendingBufferLength = len % 16; + len = len - pendingBufferLength; + } + } + if (len != 0) + encryptAndWrite(b, off, len); + } + + private void encryptAndWrite(byte[] b, int off, int len) throws IOException { + if (encrypter != null) { + try { + encrypter.encryptData(b, off, len); + } catch (ZipException e) { + throw new IOException(e.getMessage()); + } + } + outputStream.write(b, off, len); + totalBytesWritten += len; + bytesWrittenForThisFile += len; + } + + public void closeEntry() throws IOException, ZipException { + + if (this.pendingBufferLength != 0) { + encryptAndWrite(pendingBuffer, 0, pendingBufferLength); + pendingBufferLength = 0; + } + + if (this.zipParameters.isEncryptFiles() && + this.zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + if (encrypter instanceof AESEncrpyter) { + outputStream.write(((AESEncrpyter)encrypter).getFinalMac()); + bytesWrittenForThisFile += 10; + totalBytesWritten += 10; + } else { + throw new ZipException("invalid encrypter for AES encrypted file"); + } + } + fileHeader.setCompressedSize(bytesWrittenForThisFile); + localFileHeader.setCompressedSize(bytesWrittenForThisFile); + + if (zipParameters.isSourceExternalStream()) { + fileHeader.setUncompressedSize(totalBytesRead); + if (localFileHeader.getUncompressedSize() != totalBytesRead) { + localFileHeader.setUncompressedSize(totalBytesRead); + } + } + + long crc32 = crc.getValue(); + if (fileHeader.isEncrypted()) { + if (fileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + crc32 = 0; + } + } + + if (zipParameters.isEncryptFiles() && + zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + fileHeader.setCrc32(0); + localFileHeader.setCrc32(0); + } else { + fileHeader.setCrc32(crc32); + localFileHeader.setCrc32(crc32); + } + + zipModel.getLocalFileHeaderList().add(localFileHeader); + zipModel.getCentralDirectory().getFileHeaders().add(fileHeader); + + HeaderWriter headerWriter = new HeaderWriter(); + totalBytesWritten += headerWriter.writeExtendedLocalHeader(localFileHeader, outputStream); + + crc.reset(); + bytesWrittenForThisFile = 0; + encrypter = null; + totalBytesRead = 0; + } + + public void finish() throws IOException, ZipException { + zipModel.getEndCentralDirRecord().setOffsetOfStartOfCentralDir(totalBytesWritten); + + HeaderWriter headerWriter = new HeaderWriter(); + headerWriter.finalizeZipFile(zipModel, outputStream); + } + + public void close() throws IOException { + if (outputStream != null) + outputStream.close(); + } + + private void createFileHeader() throws ZipException { + this.fileHeader = new FileHeader(); + fileHeader.setSignature((int)InternalZipConstants.CENSIG); + fileHeader.setVersionMadeBy(20); + fileHeader.setVersionNeededToExtract(20); + if (zipParameters.isEncryptFiles() && + zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + fileHeader.setCompressionMethod(Zip4jConstants.ENC_METHOD_AES); + fileHeader.setAesExtraDataRecord(generateAESExtraDataRecord(zipParameters)); + } else { + fileHeader.setCompressionMethod(zipParameters.getCompressionMethod()); + } + if (zipParameters.isEncryptFiles()) { + fileHeader.setEncrypted(true); + fileHeader.setEncryptionMethod(zipParameters.getEncryptionMethod()); + } + String fileName = null; + if (zipParameters.isSourceExternalStream()) { + fileHeader.setLastModFileTime((int) Zip4jUtil.javaToDosTime(System.currentTimeMillis())); + if (!Zip4jUtil.isStringNotNullAndNotEmpty(zipParameters.getFileNameInZip())) { + throw new ZipException("fileNameInZip is null or empty"); + } + fileName = zipParameters.getFileNameInZip(); + } else { + fileHeader.setLastModFileTime((int) Zip4jUtil.javaToDosTime((Zip4jUtil.getLastModifiedFileTime( + sourceFile, zipParameters.getTimeZone())))); + fileHeader.setUncompressedSize(sourceFile.length()); + fileName = Zip4jUtil.getRelativeFileName( + sourceFile.getAbsolutePath(), zipParameters.getRootFolderInZip(), zipParameters.getDefaultFolderPath()); + + } + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("fileName is null or empty. unable to create file header"); + } + + fileHeader.setFileName(fileName); + + if (Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getFileNameCharset())) { + fileHeader.setFileNameLength(Zip4jUtil.getEncodedStringLength(fileName, + zipModel.getFileNameCharset())); + } else { + fileHeader.setFileNameLength(Zip4jUtil.getEncodedStringLength(fileName)); + } + + if (outputStream instanceof SplitOutputStream) { + fileHeader.setDiskNumberStart(((SplitOutputStream)outputStream).getCurrSplitFileCounter()); + } else { + fileHeader.setDiskNumberStart(0); + } + + int fileAttrs = 0; + if (!zipParameters.isSourceExternalStream()) + fileAttrs = getFileAttributes(sourceFile); + byte[] externalFileAttrs = {(byte)fileAttrs, 0, 0, 0}; + fileHeader.setExternalFileAttr(externalFileAttrs); + + if (zipParameters.isSourceExternalStream()) { + fileHeader.setDirectory(fileName.endsWith("/") || fileName.endsWith("\\")); + } else { + fileHeader.setDirectory(this.sourceFile.isDirectory()); + } + if (fileHeader.isDirectory()) { + fileHeader.setCompressedSize(0); + fileHeader.setUncompressedSize(0); + } else { + if (!zipParameters.isSourceExternalStream()) { + long fileSize = Zip4jUtil.getFileLengh(sourceFile); + if (zipParameters.getCompressionMethod() == Zip4jConstants.COMP_STORE) { + if (zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + fileHeader.setCompressedSize(fileSize + + InternalZipConstants.STD_DEC_HDR_SIZE); + } else if (zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + int saltLength = 0; + switch (zipParameters.getAesKeyStrength()) { + case Zip4jConstants.AES_STRENGTH_128: + saltLength = 8; + break; + case Zip4jConstants.AES_STRENGTH_256: + saltLength = 16; + break; + default: + throw new ZipException("invalid aes key strength, cannot determine key sizes"); + } + fileHeader.setCompressedSize(fileSize + saltLength + + InternalZipConstants.AES_AUTH_LENGTH + 2); //2 is password verifier + } else { + fileHeader.setCompressedSize(0); + } + } else { + fileHeader.setCompressedSize(0); + } + fileHeader.setUncompressedSize(fileSize); + } + } + if (zipParameters.isEncryptFiles() && + zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + fileHeader.setCrc32(zipParameters.getSourceFileCRC()); + } + byte[] shortByte = new byte[2]; + shortByte[0] = Raw.bitArrayToByte(generateGeneralPurposeBitArray( + fileHeader.isEncrypted(), zipParameters.getCompressionMethod())); + boolean isFileNameCharsetSet = Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getFileNameCharset()); + if ((isFileNameCharsetSet && + zipModel.getFileNameCharset().equalsIgnoreCase(InternalZipConstants.CHARSET_UTF8)) || + (!isFileNameCharsetSet && + Zip4jUtil.detectCharSet(fileHeader.getFileName()).equals(InternalZipConstants.CHARSET_UTF8))) { + shortByte[1] = 8; + } else { + shortByte[1] = 0; + } + fileHeader.setGeneralPurposeFlag(shortByte); + } + + private void createLocalFileHeader() throws ZipException { + if (fileHeader == null) { + throw new ZipException("file header is null, cannot create local file header"); + } + this.localFileHeader = new LocalFileHeader(); + localFileHeader.setSignature((int)InternalZipConstants.LOCSIG); + localFileHeader.setVersionNeededToExtract(fileHeader.getVersionNeededToExtract()); + localFileHeader.setCompressionMethod(fileHeader.getCompressionMethod()); + localFileHeader.setLastModFileTime(fileHeader.getLastModFileTime()); + localFileHeader.setUncompressedSize(fileHeader.getUncompressedSize()); + localFileHeader.setFileNameLength(fileHeader.getFileNameLength()); + localFileHeader.setFileName(fileHeader.getFileName()); + localFileHeader.setEncrypted(fileHeader.isEncrypted()); + localFileHeader.setEncryptionMethod(fileHeader.getEncryptionMethod()); + localFileHeader.setAesExtraDataRecord(fileHeader.getAesExtraDataRecord()); + localFileHeader.setCrc32(fileHeader.getCrc32()); + localFileHeader.setCompressedSize(fileHeader.getCompressedSize()); + localFileHeader.setGeneralPurposeFlag((byte[])fileHeader.getGeneralPurposeFlag().clone()); + } + + /** + * Checks the file attributes and returns an integer + * @param file + * @return + * @throws ZipException + */ + private int getFileAttributes(File file) throws ZipException { + if (file == null) { + throw new ZipException("input file is null, cannot get file attributes"); + } + + if (!file.exists()) { + return 0; + } + + if (file.isDirectory()) { + if (file.isHidden()) { + return InternalZipConstants.FOLDER_MODE_HIDDEN; + } else { + return InternalZipConstants.FOLDER_MODE_NONE; + } + } else { + if (!file.canWrite() && file.isHidden()) { + return InternalZipConstants.FILE_MODE_READ_ONLY_HIDDEN; + } else if (!file.canWrite()) { + return InternalZipConstants.FILE_MODE_READ_ONLY; + } else if (file.isHidden()) { + return InternalZipConstants.FILE_MODE_HIDDEN; + } else { + return InternalZipConstants.FILE_MODE_NONE; + } + } + } + + private int[] generateGeneralPurposeBitArray(boolean isEncrpyted, int compressionMethod) { + + int[] generalPurposeBits = new int[8]; + if (isEncrpyted) { + generalPurposeBits[0] = 1; + } else { + generalPurposeBits[0] = 0; + } + + if (compressionMethod == Zip4jConstants.COMP_DEFLATE) { + // Have to set flags for deflate + } else { + generalPurposeBits[1] = 0; + generalPurposeBits[2] = 0; + } + + generalPurposeBits[3] = 1; + + return generalPurposeBits; + } + + private AESExtraDataRecord generateAESExtraDataRecord(ZipParameters parameters) throws ZipException { + + if (parameters == null) { + throw new ZipException("zip parameters are null, cannot generate AES Extra Data record"); + } + + AESExtraDataRecord aesDataRecord = new AESExtraDataRecord(); + aesDataRecord.setSignature(InternalZipConstants.AESSIG); + aesDataRecord.setDataSize(7); + aesDataRecord.setVendorID("AE"); + // Always set the version number to 2 as we do not store CRC for any AES encrypted files + // only MAC is stored and as per the specification, if version number is 2, then MAC is read + // and CRC is ignored + aesDataRecord.setVersionNumber(2); + if (parameters.getAesKeyStrength() == Zip4jConstants.AES_STRENGTH_128) { + aesDataRecord.setAesStrength(Zip4jConstants.AES_STRENGTH_128); + } else if (parameters.getAesKeyStrength() == Zip4jConstants.AES_STRENGTH_256) { + aesDataRecord.setAesStrength(Zip4jConstants.AES_STRENGTH_256); + } else { + throw new ZipException("invalid AES key strength, cannot generate AES Extra data record"); + } + aesDataRecord.setCompressionMethod(parameters.getCompressionMethod()); + + return aesDataRecord; + } + + public void decrementCompressedFileSize(int value) { + if (value <= 0) return; + + if (value <= this.bytesWrittenForThisFile) { + this.bytesWrittenForThisFile -= value; + } + } + + protected void updateTotalBytesRead(int toUpdate) { + if (toUpdate > 0) { + totalBytesRead += toUpdate; + } + } + + public void setSourceFile(File sourceFile) { + this.sourceFile = sourceFile; + } + + public File getSourceFile() { + return sourceFile; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/DeflaterOutputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/DeflaterOutputStream.java new file mode 100644 index 00000000..0e6deb9a --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/DeflaterOutputStream.java @@ -0,0 +1,115 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.io; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.zip.Deflater; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.model.ZipParameters; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jConstants; + +public class DeflaterOutputStream extends CipherOutputStream { + + private byte[] buff; + protected Deflater deflater; + private boolean firstBytesRead; + + public DeflaterOutputStream(OutputStream outputStream, ZipModel zipModel) { + super(outputStream, zipModel); + deflater = new Deflater(); + buff = new byte[InternalZipConstants.BUFF_SIZE]; + firstBytesRead = false; + } + + public void putNextEntry(File file, ZipParameters zipParameters) + throws ZipException { + super.putNextEntry(file, zipParameters); + if (zipParameters.getCompressionMethod() == Zip4jConstants.COMP_DEFLATE) { + deflater.reset(); + if ((zipParameters.getCompressionLevel() < 0 || zipParameters + .getCompressionLevel() > 9) + && zipParameters.getCompressionLevel() != -1) { + throw new ZipException( + "invalid compression level for deflater. compression level should be in the range of 0-9"); + } + deflater.setLevel(zipParameters.getCompressionLevel()); + } + } + + public void write(byte[] b) throws IOException { + write(b, 0, b.length); + } + + private void deflate () throws IOException { + int len = deflater.deflate(buff, 0, buff.length); + if (len > 0) { + if (deflater.finished()) { + if (len == 4) return; + if (len < 4) { + decrementCompressedFileSize(4 - len); + return; + } + len -= 4; + } + if (!firstBytesRead) { + super.write(buff, 2, len - 2); + firstBytesRead = true; + } else { + super.write(buff, 0, len); + } + } + } + + public void write(int bval) throws IOException { + byte[] b = new byte[1]; + b[0] = (byte) bval; + write(b, 0, 1); + } + + public void write(byte[] buf, int off, int len) throws IOException { + if (zipParameters.getCompressionMethod() != Zip4jConstants.COMP_DEFLATE) { + super.write(buf, off, len); + } else { + deflater.setInput(buf, off, len); + while (!deflater.needsInput()) { + deflate(); + } + } + } + + public void closeEntry() throws IOException, ZipException { + if (zipParameters.getCompressionMethod() == Zip4jConstants.COMP_DEFLATE) { + if (!deflater.finished()) { + deflater.finish(); + while (!deflater.finished()) { + deflate(); + } + } + firstBytesRead = false; + } + super.closeEntry(); + } + + public void finish() throws IOException, ZipException { + super.finish(); + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/InflaterInputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/InflaterInputStream.java new file mode 100644 index 00000000..567bac1f --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/InflaterInputStream.java @@ -0,0 +1,174 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.io; + +import java.io.EOFException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.zip.DataFormatException; +import java.util.zip.Inflater; + +import net.lingala.zip4j.unzip.UnzipEngine; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jConstants; + +public class InflaterInputStream extends PartInputStream { + + private Inflater inflater; + private byte[] buff; + private byte[] oneByteBuff = new byte[1]; + private UnzipEngine unzipEngine; + private long bytesWritten; + private long uncompressedSize; + + public InflaterInputStream(RandomAccessFile raf, long start, long len, UnzipEngine unzipEngine) { + super(raf, start, len, unzipEngine); + this.inflater = new Inflater(true); + this.buff = new byte[InternalZipConstants.BUFF_SIZE]; + this.unzipEngine = unzipEngine; + bytesWritten = 0; + uncompressedSize = unzipEngine.getFileHeader().getUncompressedSize(); + } + + public int read() throws IOException { + return read(oneByteBuff, 0, 1) == -1 ? -1 : oneByteBuff[0] & 0xff; + } + + public int read(byte[] b) throws IOException { + if (b == null) { + throw new NullPointerException("input buffer is null"); + } + + return read(b, 0, b.length); + } + + public int read(byte[] b, int off, int len) throws IOException { + + if (b == null) { + throw new NullPointerException("input buffer is null"); + } else if (off < 0 || len < 0 || len > b.length - off) { + throw new IndexOutOfBoundsException(); + } else if (len == 0) { + return 0; + } + + try { + int n; + if (bytesWritten >= uncompressedSize) { + finishInflating(); + return -1; + } + while ((n = inflater.inflate(b, off, len)) == 0) { + if (inflater.finished() || inflater.needsDictionary()) { + finishInflating(); + return -1; + } + if (inflater.needsInput()) { + fill(); + } + } + bytesWritten += n; + return n; + } catch (DataFormatException e) { + String s = "Invalid ZLIB data format"; + if (e.getMessage() != null) { + s = e.getMessage(); + } + if (unzipEngine != null) { + if (unzipEngine.getLocalFileHeader().isEncrypted() && + unzipEngine.getLocalFileHeader().getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + s += " - Wrong Password?"; + } + } + throw new IOException(s); + } + } + + private void finishInflating() throws IOException { + //In some cases, compelte data is not read even though inflater is complete + //make sure to read complete data before returning -1 + byte[] b = new byte[1024]; + while (super.read(b, 0, 1024) != -1) { + //read all data + } + checkAndReadAESMacBytes(); + } + + private void fill() throws IOException { + int len = super.read(buff, 0, buff.length); + if (len == -1) { + throw new EOFException("Unexpected end of ZLIB input stream"); + } + inflater.setInput(buff, 0, len); + } + + /** + * Skips specified number of bytes of uncompressed data. + * @param n the number of bytes to skip + * @return the actual number of bytes skipped. + * @exception IOException if an I/O error has occurred + * @exception IllegalArgumentException if n < 0 + */ + public long skip(long n) throws IOException { + if (n < 0) { + throw new IllegalArgumentException("negative skip length"); + } + int max = (int)Math.min(n, Integer.MAX_VALUE); + int total = 0; + byte[] b = new byte[512]; + while (total < max) { + int len = max - total; + if (len > b.length) { + len = b.length; + } + len = read(b, 0, len); + if (len == -1) { + break; + } + total += len; + } + return total; + } + + + public void seek(long pos) throws IOException { + super.seek(pos); + } + + /** + * Returns 0 after EOF has been reached, otherwise always return 1. + *

+ * Programs should not count on this method to return the actual number + * of bytes that could be read without blocking. + * + * @return 1 before EOF and 0 after EOF. + * @exception IOException if an I/O error occurs. + * + */ + public int available() { + return inflater.finished() ? 0 : 1; + } + + public void close() throws IOException { + inflater.end(); + super.close(); + } + + public UnzipEngine getUnzipEngine() { + return super.getUnzipEngine(); + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/PartInputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/PartInputStream.java new file mode 100644 index 00000000..8f7c77f2 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/PartInputStream.java @@ -0,0 +1,172 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.io; + +import java.io.IOException; +import java.io.RandomAccessFile; + +import net.lingala.zip4j.crypto.AESDecrypter; +import net.lingala.zip4j.crypto.IDecrypter; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.unzip.UnzipEngine; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jConstants; + +public class PartInputStream extends BaseInputStream +{ + private RandomAccessFile raf; + private long bytesRead, length; + private UnzipEngine unzipEngine; + private IDecrypter decrypter; + private byte[] oneByteBuff = new byte[1]; + private byte[] aesBlockByte = new byte[16]; + private int aesBytesReturned = 0; + private boolean isAESEncryptedFile = false; + private int count = -1; + + public PartInputStream(RandomAccessFile raf, long start, long len, UnzipEngine unzipEngine) { + this.raf = raf; + this.unzipEngine = unzipEngine; + this.decrypter = unzipEngine.getDecrypter(); + this.bytesRead = 0; + this.length = len; + this.isAESEncryptedFile = unzipEngine.getFileHeader().isEncrypted() && + unzipEngine.getFileHeader().getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES; + } + + public int available() { + long amount = length - bytesRead; + if (amount > Integer.MAX_VALUE) + return Integer.MAX_VALUE; + return (int) amount; + } + + public int read() throws IOException { + if (bytesRead >= length) + return -1; + + if (isAESEncryptedFile) { + if (aesBytesReturned == 0 || aesBytesReturned == 16) { + if (read(aesBlockByte) == -1) { + return -1; + } + aesBytesReturned = 0; + } + return aesBlockByte[aesBytesReturned++] & 0xff; + } else { + return read(oneByteBuff, 0, 1) == -1 ? -1 : oneByteBuff[0] & 0xff; + } + } + + public int read(byte[] b) throws IOException { + return this.read(b, 0, b.length); + } + + public int read(byte[] b, int off, int len) throws IOException { + if (len > length - bytesRead) { + len = (int) (length - bytesRead); + if (len == 0) { + checkAndReadAESMacBytes(); + return -1; + } + } + + if (unzipEngine.getDecrypter() instanceof AESDecrypter) { + if (bytesRead + len < length) { + if (len % 16 != 0) { + len = len - (len%16); + } + } + } + + synchronized (raf) { + count = raf.read(b, off, len); + if ((count < len) && unzipEngine.getZipModel().isSplitArchive()) { + raf.close(); + raf = unzipEngine.startNextSplitFile(); + if (count < 0) count = 0; + int newlyRead = raf.read(b, count, len-count); + if (newlyRead > 0) + count += newlyRead; + } + } + + if (count > 0) { + if (decrypter != null) { + try { + decrypter.decryptData(b, off, count); + } catch (ZipException e) { + throw new IOException(e.getMessage()); + } + } + bytesRead += count; + } + + if (bytesRead >= length) { + checkAndReadAESMacBytes(); + } + + return count; + } + + protected void checkAndReadAESMacBytes() throws IOException { + if (isAESEncryptedFile) { + if (decrypter != null && decrypter instanceof AESDecrypter) { + if (((AESDecrypter)decrypter).getStoredMac() != null) { + //Stored mac already set + return; + } + byte[] macBytes = new byte[InternalZipConstants.AES_AUTH_LENGTH]; + int readLen = -1; + readLen = raf.read(macBytes); + if (readLen != InternalZipConstants.AES_AUTH_LENGTH) { + if (unzipEngine.getZipModel().isSplitArchive()) { + raf.close(); + raf = unzipEngine.startNextSplitFile(); + int newlyRead = raf.read(macBytes, readLen, InternalZipConstants.AES_AUTH_LENGTH - readLen); + readLen += newlyRead; + } else { + throw new IOException("Error occured while reading stored AES authentication bytes"); + } + } + + ((AESDecrypter)unzipEngine.getDecrypter()).setStoredMac(macBytes); + } + } + } + + public long skip(long amount) throws IOException { + if (amount < 0) + throw new IllegalArgumentException(); + if (amount > length - bytesRead) + amount = length - bytesRead; + bytesRead += amount; + return amount; + } + + public void close() throws IOException { + raf.close(); + } + + public void seek(long pos) throws IOException { + raf.seek(pos); + } + + public UnzipEngine getUnzipEngine() { + return this.unzipEngine; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/SplitOutputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/SplitOutputStream.java new file mode 100644 index 00000000..d4b0c475 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/SplitOutputStream.java @@ -0,0 +1,234 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.io; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.OutputStream; +import java.io.RandomAccessFile; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Raw; +import net.lingala.zip4j.util.Zip4jUtil; + +public class SplitOutputStream extends OutputStream { + + private RandomAccessFile raf; + private long splitLength; + private File zipFile; + private File outFile; + private int currSplitFileCounter; + private long bytesWrittenForThisPart; + + public SplitOutputStream(String name) throws FileNotFoundException, ZipException { + this(Zip4jUtil.isStringNotNullAndNotEmpty(name) ? + new File(name) : null); + } + + public SplitOutputStream(File file) throws FileNotFoundException, ZipException { + this(file, -1); + } + + public SplitOutputStream(String name, long splitLength) throws FileNotFoundException, ZipException { + this(!Zip4jUtil.isStringNotNullAndNotEmpty(name) ? + new File(name) : null, splitLength); + } + + public SplitOutputStream(File file, long splitLength) throws FileNotFoundException, ZipException { + if (splitLength >= 0 && splitLength < InternalZipConstants.MIN_SPLIT_LENGTH) { + throw new ZipException("split length less than minimum allowed split length of " + InternalZipConstants.MIN_SPLIT_LENGTH +" Bytes"); + } + this.raf = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE); + this.splitLength = splitLength; + this.outFile = file; + this.zipFile = file; + this.currSplitFileCounter = 0; + this.bytesWrittenForThisPart = 0; + } + + public void write(int b) throws IOException { + byte[] buff = new byte[1]; + buff[0] = (byte) b; + write(buff, 0, 1); + } + + public void write(byte[] b) throws IOException { + write(b, 0, b.length); + } + + public void write(byte[] b, int off, int len) throws IOException { + if (len <= 0) return; + + if (splitLength != -1) { + + if (splitLength < InternalZipConstants.MIN_SPLIT_LENGTH) { + throw new IOException("split length less than minimum allowed split length of " + InternalZipConstants.MIN_SPLIT_LENGTH +" Bytes"); + } + + if (bytesWrittenForThisPart >= splitLength) { + startNextSplitFile(); + raf.write(b, off, len); + bytesWrittenForThisPart = len; + } else if (bytesWrittenForThisPart + len > splitLength) { + if (isHeaderData(b)) { + startNextSplitFile(); + raf.write(b, off, len); + bytesWrittenForThisPart = len; + } else { + raf.write(b, off, (int)(splitLength - bytesWrittenForThisPart)); + startNextSplitFile(); + raf.write(b, off + (int)(splitLength - bytesWrittenForThisPart), (int)(len - (splitLength - bytesWrittenForThisPart))); + bytesWrittenForThisPart = len - (splitLength - bytesWrittenForThisPart); + } + } else { + raf.write(b, off, len); + bytesWrittenForThisPart += len; + } + + } else { + raf.write(b, off, len); + bytesWrittenForThisPart += len; + } + + } + + private void startNextSplitFile() throws IOException { + try { + String zipFileWithoutExt = Zip4jUtil.getZipFileNameWithoutExt(outFile.getName()); + File currSplitFile = null; + String zipFileName = zipFile.getAbsolutePath(); + String parentPath = (outFile.getParent() == null)?"":outFile.getParent() + System.getProperty("file.separator"); + + if (currSplitFileCounter < 9) { + currSplitFile = new File(parentPath + zipFileWithoutExt + ".z0" + (currSplitFileCounter + 1)); + } else { + currSplitFile = new File(parentPath + zipFileWithoutExt + ".z" + (currSplitFileCounter + 1)); + } + + raf.close(); + + if (currSplitFile.exists()) { + throw new IOException("split file: " + currSplitFile.getName() + " already exists in the current directory, cannot rename this file"); + } + + if (!zipFile.renameTo(currSplitFile)) { + throw new IOException("cannot rename newly created split file"); + } + + zipFile = new File(zipFileName); + raf = new RandomAccessFile(zipFile, InternalZipConstants.WRITE_MODE); + currSplitFileCounter++; + } catch (ZipException e) { + throw new IOException(e.getMessage()); + } + } + + private boolean isHeaderData(byte[] buff) { + if (buff == null || buff.length < 4) { + return false; + } + + int signature = Raw.readIntLittleEndian(buff, 0); + long[] allHeaderSignatures = Zip4jUtil.getAllHeaderSignatures(); + if (allHeaderSignatures != null && allHeaderSignatures.length > 0) { + for (int i = 0; i < allHeaderSignatures.length; i++) { + //Ignore split signature + if (allHeaderSignatures[i] != InternalZipConstants.SPLITSIG && + allHeaderSignatures[i] == signature) { + return true; + } + } + } + + return false; + } + + /** + * Checks if the buffer size is sufficient for the current split file. If not + * a new split file will be started. + * @param bufferSize + * @return true if a new split file was started else false + * @throws ZipException + */ + public boolean checkBuffSizeAndStartNextSplitFile(int bufferSize) throws ZipException { + if (bufferSize < 0) { + throw new ZipException("negative buffersize for checkBuffSizeAndStartNextSplitFile"); + } + + if (!isBuffSizeFitForCurrSplitFile(bufferSize)) { + try { + startNextSplitFile(); + bytesWrittenForThisPart = 0; + return true; + } catch (IOException e) { + throw new ZipException(e); + } + } + + return false; + } + + /** + * Checks if the given buffer size will be fit in the current split file. + * If this output stream is a non-split file, then this method always returns true + * @param bufferSize + * @return true if the buffer size is fit in the current split file or else false. + * @throws ZipException + */ + public boolean isBuffSizeFitForCurrSplitFile(int bufferSize) throws ZipException { + if (bufferSize < 0) { + throw new ZipException("negative buffersize for isBuffSizeFitForCurrSplitFile"); + } + + if (splitLength >= InternalZipConstants.MIN_SPLIT_LENGTH) { + return (bytesWrittenForThisPart + bufferSize <= splitLength); + } else { + //Non split zip -- return true + return true; + } + } + + public void seek(long pos) throws IOException { + raf.seek(pos); + } + + public void close() throws IOException { + if (raf != null) + raf.close(); + } + + public void flush() throws IOException { + } + + public long getFilePointer() throws IOException { + return raf.getFilePointer(); + } + + public boolean isSplitZipFile() { + return splitLength!=-1; + } + + public long getSplitLength() { + return splitLength; + } + + public int getCurrSplitFileCounter() { + return currSplitFileCounter; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/ZipInputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/ZipInputStream.java new file mode 100644 index 00000000..a2b9d612 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/ZipInputStream.java @@ -0,0 +1,89 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.io; + +import java.io.IOException; +import java.io.InputStream; + +import net.lingala.zip4j.exception.ZipException; + +public class ZipInputStream extends InputStream { + + private BaseInputStream is; + + public ZipInputStream(BaseInputStream is) { + this.is = is; + } + + public int read() throws IOException { + int readByte = is.read(); + if (readByte != -1) { + is.getUnzipEngine().updateCRC(readByte); + } + return readByte; + } + + public int read(byte[] b) throws IOException { + return read(b, 0, b.length); + } + + public int read(byte[] b, int off, int len) throws IOException { + int readLen = is.read(b, off, len); + if (readLen > 0 && is.getUnzipEngine() != null) { + is.getUnzipEngine().updateCRC(b, off, readLen); + } + return readLen; + } + + /** + * Closes the input stream and releases any resources. + * This method also checks for the CRC of the extracted file. + * If CRC check has to be skipped use close(boolean skipCRCCheck) method + * + * @throws IOException + */ + public void close() throws IOException { + close(false); + } + + /** + * Closes the input stream and releases any resources. + * If skipCRCCheck flag is set to true, this method skips CRC Check + * of the extracted file + * + * @throws IOException + */ + public void close(boolean skipCRCCheck) throws IOException { + try { + is.close(); + if (!skipCRCCheck && is.getUnzipEngine() != null) { + is.getUnzipEngine().checkCRC(); + } + } catch (ZipException e) { + throw new IOException(e.getMessage()); + } + } + + public int available() throws IOException { + return is.available(); + } + + public long skip(long n) throws IOException { + return is.skip(n); + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/io/ZipOutputStream.java b/lib/zip4j/src/net/lingala/zip4j/io/ZipOutputStream.java new file mode 100644 index 00000000..44eb720f --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/io/ZipOutputStream.java @@ -0,0 +1,33 @@ +package net.lingala.zip4j.io; + +import java.io.IOException; +import java.io.OutputStream; + +import net.lingala.zip4j.model.ZipModel; + +public class ZipOutputStream extends DeflaterOutputStream { + + public ZipOutputStream(OutputStream outputStream) { + this(outputStream, null); + } + + public ZipOutputStream(OutputStream outputStream, ZipModel zipModel) { + super(outputStream, zipModel); + } + + public void write(int bval) throws IOException { + byte[] b = new byte[1]; + b[0] = (byte) bval; + write(b, 0, 1); + } + + public void write(byte[] b) throws IOException { + write(b, 0, b.length); + } + + public void write(byte[] b, int off, int len) throws IOException { + crc.update(b, off, len); + updateTotalBytesRead(len); + super.write(b, off, len); + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/AESExtraDataRecord.java b/lib/zip4j/src/net/lingala/zip4j/model/AESExtraDataRecord.java new file mode 100644 index 00000000..c71a47b0 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/AESExtraDataRecord.java @@ -0,0 +1,97 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class AESExtraDataRecord { + + private long signature; + private int dataSize; + private int versionNumber; + private String vendorID; + private int aesStrength; + private int compressionMethod; + + public AESExtraDataRecord() { + signature = -1; + dataSize = -1; + versionNumber = -1; + vendorID = null; + aesStrength = -1; + compressionMethod = -1; + } + + + public long getSignature() { + return signature; + } + + + public void setSignature(long signature) { + this.signature = signature; + } + + + public int getDataSize() { + return dataSize; + } + + + public void setDataSize(int dataSize) { + this.dataSize = dataSize; + } + + + public int getVersionNumber() { + return versionNumber; + } + + + public void setVersionNumber(int versionNumber) { + this.versionNumber = versionNumber; + } + + + public String getVendorID() { + return vendorID; + } + + + public void setVendorID(String vendorID) { + this.vendorID = vendorID; + } + + + public int getAesStrength() { + return aesStrength; + } + + + public void setAesStrength(int aesStrength) { + this.aesStrength = aesStrength; + } + + + public int getCompressionMethod() { + return compressionMethod; + } + + + public void setCompressionMethod(int compressionMethod) { + this.compressionMethod = compressionMethod; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/ArchiveExtraDataRecord.java b/lib/zip4j/src/net/lingala/zip4j/model/ArchiveExtraDataRecord.java new file mode 100644 index 00000000..d824d4e4 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/ArchiveExtraDataRecord.java @@ -0,0 +1,51 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class ArchiveExtraDataRecord { + + private int signature; + + private int extraFieldLength; + + private String extraFieldData; + + public int getSignature() { + return signature; + } + + public void setSignature(int signature) { + this.signature = signature; + } + + public int getExtraFieldLength() { + return extraFieldLength; + } + + public void setExtraFieldLength(int extraFieldLength) { + this.extraFieldLength = extraFieldLength; + } + + public String getExtraFieldData() { + return extraFieldData; + } + + public void setExtraFieldData(String extraFieldData) { + this.extraFieldData = extraFieldData; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/CentralDirectory.java b/lib/zip4j/src/net/lingala/zip4j/model/CentralDirectory.java new file mode 100644 index 00000000..502156f6 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/CentralDirectory.java @@ -0,0 +1,44 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +import java.util.ArrayList; + +public class CentralDirectory { + + private ArrayList fileHeaders; + + private DigitalSignature digitalSignature; + + public ArrayList getFileHeaders() { + return fileHeaders; + } + + public void setFileHeaders(ArrayList fileHeaders) { + this.fileHeaders = fileHeaders; + } + + public DigitalSignature getDigitalSignature() { + return digitalSignature; + } + + public void setDigitalSignature(DigitalSignature digitalSignature) { + this.digitalSignature = digitalSignature; + } + + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/DataDescriptor.java b/lib/zip4j/src/net/lingala/zip4j/model/DataDescriptor.java new file mode 100644 index 00000000..0b0625b0 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/DataDescriptor.java @@ -0,0 +1,51 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class DataDescriptor { + + private String crc32; + + private int compressedSize; + + private int uncompressedSize; + + public String getCrc32() { + return crc32; + } + + public void setCrc32(String crc32) { + this.crc32 = crc32; + } + + public int getCompressedSize() { + return compressedSize; + } + + public void setCompressedSize(int compressedSize) { + this.compressedSize = compressedSize; + } + + public int getUncompressedSize() { + return uncompressedSize; + } + + public void setUncompressedSize(int uncompressedSize) { + this.uncompressedSize = uncompressedSize; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/DigitalSignature.java b/lib/zip4j/src/net/lingala/zip4j/model/DigitalSignature.java new file mode 100644 index 00000000..ffc0954f --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/DigitalSignature.java @@ -0,0 +1,51 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class DigitalSignature { + + private int headerSignature; + + private int sizeOfData; + + private String signatureData; + + public int getHeaderSignature() { + return headerSignature; + } + + public void setHeaderSignature(int headerSignature) { + this.headerSignature = headerSignature; + } + + public int getSizeOfData() { + return sizeOfData; + } + + public void setSizeOfData(int sizeOfData) { + this.sizeOfData = sizeOfData; + } + + public String getSignatureData() { + return signatureData; + } + + public void setSignatureData(String signatureData) { + this.signatureData = signatureData; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/EndCentralDirRecord.java b/lib/zip4j/src/net/lingala/zip4j/model/EndCentralDirRecord.java new file mode 100644 index 00000000..64ec5c57 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/EndCentralDirRecord.java @@ -0,0 +1,122 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class EndCentralDirRecord { + + private long signature; + + private int noOfThisDisk; + + private int noOfThisDiskStartOfCentralDir; + + private int totNoOfEntriesInCentralDirOnThisDisk; + + private int totNoOfEntriesInCentralDir; + + private int sizeOfCentralDir; + + private long offsetOfStartOfCentralDir; + + private int commentLength; + + private String comment; + + private byte[] commentBytes; + + public long getSignature() { + return signature; + } + + public void setSignature(long signature) { + this.signature = signature; + } + + public int getNoOfThisDisk() { + return noOfThisDisk; + } + + public void setNoOfThisDisk(int noOfThisDisk) { + this.noOfThisDisk = noOfThisDisk; + } + + public int getNoOfThisDiskStartOfCentralDir() { + return noOfThisDiskStartOfCentralDir; + } + + public void setNoOfThisDiskStartOfCentralDir(int noOfThisDiskStartOfCentralDir) { + this.noOfThisDiskStartOfCentralDir = noOfThisDiskStartOfCentralDir; + } + + public int getTotNoOfEntriesInCentralDirOnThisDisk() { + return totNoOfEntriesInCentralDirOnThisDisk; + } + + public void setTotNoOfEntriesInCentralDirOnThisDisk( + int totNoOfEntriesInCentralDirOnThisDisk) { + this.totNoOfEntriesInCentralDirOnThisDisk = totNoOfEntriesInCentralDirOnThisDisk; + } + + public int getTotNoOfEntriesInCentralDir() { + return totNoOfEntriesInCentralDir; + } + + public void setTotNoOfEntriesInCentralDir(int totNoOfEntrisInCentralDir) { + this.totNoOfEntriesInCentralDir = totNoOfEntrisInCentralDir; + } + + public int getSizeOfCentralDir() { + return sizeOfCentralDir; + } + + public void setSizeOfCentralDir(int sizeOfCentralDir) { + this.sizeOfCentralDir = sizeOfCentralDir; + } + + public long getOffsetOfStartOfCentralDir() { + return offsetOfStartOfCentralDir; + } + + public void setOffsetOfStartOfCentralDir(long offSetOfStartOfCentralDir) { + this.offsetOfStartOfCentralDir = offSetOfStartOfCentralDir; + } + + public int getCommentLength() { + return commentLength; + } + + public void setCommentLength(int commentLength) { + this.commentLength = commentLength; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public byte[] getCommentBytes() { + return commentBytes; + } + + public void setCommentBytes(byte[] commentBytes) { + this.commentBytes = commentBytes; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/ExtraDataRecord.java b/lib/zip4j/src/net/lingala/zip4j/model/ExtraDataRecord.java new file mode 100644 index 00000000..a6baf0c5 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/ExtraDataRecord.java @@ -0,0 +1,51 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class ExtraDataRecord { + + private long header; + + private int sizeOfData; + + private byte[] data; + + public long getHeader() { + return header; + } + + public void setHeader(long header) { + this.header = header; + } + + public int getSizeOfData() { + return sizeOfData; + } + + public void setSizeOfData(int sizeOfData) { + this.sizeOfData = sizeOfData; + } + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/FileHeader.java b/lib/zip4j/src/net/lingala/zip4j/model/FileHeader.java new file mode 100644 index 00000000..5485bc0a --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/FileHeader.java @@ -0,0 +1,369 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +import java.util.ArrayList; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.progress.ProgressMonitor; +import net.lingala.zip4j.unzip.Unzip; +import net.lingala.zip4j.util.Zip4jUtil; + +public class FileHeader { + + private int signature; + + private int versionMadeBy; + + private int versionNeededToExtract; + + private byte[] generalPurposeFlag; + + private int compressionMethod; + + private int lastModFileTime; + + private long crc32; + + private byte[] crcBuff; + + private long compressedSize; + + private long uncompressedSize; + + private int fileNameLength; + + private int extraFieldLength; + + private int fileCommentLength; + + private int diskNumberStart; + + private byte[] internalFileAttr; + + private byte[] externalFileAttr; + + private long offsetLocalHeader; + + private String fileName; + + private String fileComment; + + private boolean isDirectory; + + private boolean isEncrypted; + + private int encryptionMethod; + + private char[] password; + + private boolean dataDescriptorExists; + + private Zip64ExtendedInfo zip64ExtendedInfo; + + private AESExtraDataRecord aesExtraDataRecord; + + private ArrayList extraDataRecords; + + private boolean fileNameUTF8Encoded; + + public FileHeader() { + encryptionMethod = -1; + crc32 = 0; + uncompressedSize = 0; + } + + public int getSignature() { + return signature; + } + + public void setSignature(int signature) { + this.signature = signature; + } + + public int getVersionMadeBy() { + return versionMadeBy; + } + + public void setVersionMadeBy(int versionMadeBy) { + this.versionMadeBy = versionMadeBy; + } + + public int getVersionNeededToExtract() { + return versionNeededToExtract; + } + + public void setVersionNeededToExtract(int versionNeededToExtract) { + this.versionNeededToExtract = versionNeededToExtract; + } + + public byte[] getGeneralPurposeFlag() { + return generalPurposeFlag; + } + + public void setGeneralPurposeFlag(byte[] generalPurposeFlag) { + this.generalPurposeFlag = generalPurposeFlag; + } + + public int getCompressionMethod() { + return compressionMethod; + } + + public void setCompressionMethod(int compressionMethod) { + this.compressionMethod = compressionMethod; + } + + public int getLastModFileTime() { + return lastModFileTime; + } + + public void setLastModFileTime(int lastModFileTime) { + this.lastModFileTime = lastModFileTime; + } + + public long getCrc32() { + return crc32 & 0xffffffffL; + } + + public void setCrc32(long crc32) { + this.crc32 = crc32; + } + + public long getCompressedSize() { + return compressedSize; + } + + public void setCompressedSize(long compressedSize) { + this.compressedSize = compressedSize; + } + + public long getUncompressedSize() { + return uncompressedSize; + } + + public void setUncompressedSize(long uncompressedSize) { + this.uncompressedSize = uncompressedSize; + } + + public int getFileNameLength() { + return fileNameLength; + } + + public void setFileNameLength(int fileNameLength) { + this.fileNameLength = fileNameLength; + } + + public int getExtraFieldLength() { + return extraFieldLength; + } + + public void setExtraFieldLength(int extraFieldLength) { + this.extraFieldLength = extraFieldLength; + } + + public int getFileCommentLength() { + return fileCommentLength; + } + + public void setFileCommentLength(int fileCommentLength) { + this.fileCommentLength = fileCommentLength; + } + + public int getDiskNumberStart() { + return diskNumberStart; + } + + public void setDiskNumberStart(int diskNumberStart) { + this.diskNumberStart = diskNumberStart; + } + + public byte[] getInternalFileAttr() { + return internalFileAttr; + } + + public void setInternalFileAttr(byte[] internalFileAttr) { + this.internalFileAttr = internalFileAttr; + } + + public byte[] getExternalFileAttr() { + return externalFileAttr; + } + + public void setExternalFileAttr(byte[] externalFileAttr) { + this.externalFileAttr = externalFileAttr; + } + + public long getOffsetLocalHeader() { + return offsetLocalHeader; + } + + public void setOffsetLocalHeader(long offsetLocalHeader) { + this.offsetLocalHeader = offsetLocalHeader; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getFileComment() { + return fileComment; + } + + public void setFileComment(String fileComment) { + this.fileComment = fileComment; + } + + public boolean isDirectory() { + return isDirectory; + } + + public void setDirectory(boolean isDirectory) { + this.isDirectory = isDirectory; + } + + /** + * Extracts file to the specified directory + * @param zipModel + * @param outPath + * @throws ZipException + */ + public void extractFile(ZipModel zipModel, String outPath, + ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + extractFile(zipModel, outPath, null, progressMonitor, runInThread); + } + + /** + * Extracts file to the specified directory using any + * user defined parameters in UnzipParameters + * @param zipModel + * @param outPath + * @param unzipParameters + * @throws ZipException + */ + public void extractFile(ZipModel zipModel, String outPath, + UnzipParameters unzipParameters, ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + extractFile(zipModel, outPath, unzipParameters, null, progressMonitor, runInThread); + } + + /** + * Extracts file to the specified directory using any + * user defined parameters in UnzipParameters. Output file name + * will be overwritten with the value in newFileName. If this + * parameter is null, then file name will be the same as in + * FileHeader.getFileName + * @param zipModel + * @param outPath + * @param unzipParameters + * @throws ZipException + */ + public void extractFile(ZipModel zipModel, String outPath, + UnzipParameters unzipParameters, String newFileName, + ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + if (zipModel == null) { + throw new ZipException("input zipModel is null"); + } + + if (!Zip4jUtil.checkOutputFolder(outPath)) { + throw new ZipException("Invalid output path"); + } + + if (this == null) { + throw new ZipException("invalid file header"); + } + Unzip unzip = new Unzip(zipModel); + unzip.extractFile(this, outPath, unzipParameters, newFileName, progressMonitor, runInThread); + } + + public boolean isEncrypted() { + return isEncrypted; + } + + public void setEncrypted(boolean isEncrypted) { + this.isEncrypted = isEncrypted; + } + + public int getEncryptionMethod() { + return encryptionMethod; + } + + public void setEncryptionMethod(int encryptionMethod) { + this.encryptionMethod = encryptionMethod; + } + + public char[] getPassword() { + return password; + } + + public void setPassword(char[] password) { + this.password = password; + } + + public byte[] getCrcBuff() { + return crcBuff; + } + + public void setCrcBuff(byte[] crcBuff) { + this.crcBuff = crcBuff; + } + + public ArrayList getExtraDataRecords() { + return extraDataRecords; + } + + public void setExtraDataRecords(ArrayList extraDataRecords) { + this.extraDataRecords = extraDataRecords; + } + + public boolean isDataDescriptorExists() { + return dataDescriptorExists; + } + + public void setDataDescriptorExists(boolean dataDescriptorExists) { + this.dataDescriptorExists = dataDescriptorExists; + } + + public Zip64ExtendedInfo getZip64ExtendedInfo() { + return zip64ExtendedInfo; + } + + public void setZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo) { + this.zip64ExtendedInfo = zip64ExtendedInfo; + } + + public AESExtraDataRecord getAesExtraDataRecord() { + return aesExtraDataRecord; + } + + public void setAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord) { + this.aesExtraDataRecord = aesExtraDataRecord; + } + + public boolean isFileNameUTF8Encoded() { + return fileNameUTF8Encoded; + } + + public void setFileNameUTF8Encoded(boolean fileNameUTF8Encoded) { + this.fileNameUTF8Encoded = fileNameUTF8Encoded; + } + + + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/LocalFileHeader.java b/lib/zip4j/src/net/lingala/zip4j/model/LocalFileHeader.java new file mode 100644 index 00000000..5b38815c --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/LocalFileHeader.java @@ -0,0 +1,261 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +import java.util.ArrayList; + +public class LocalFileHeader { + + private int signature; + + private int versionNeededToExtract; + + private byte[] generalPurposeFlag; + + private int compressionMethod; + + private int lastModFileTime; + + private long crc32; + + private byte[] crcBuff; + + private long compressedSize; + + private long uncompressedSize; + + private int fileNameLength; + + private int extraFieldLength; + + private String fileName; + + private byte[] extraField; + + private long offsetStartOfData; + + private boolean isEncrypted; + + private int encryptionMethod; + + private char[] password; + + private ArrayList extraDataRecords; + + private Zip64ExtendedInfo zip64ExtendedInfo; + + private AESExtraDataRecord aesExtraDataRecord; + + private boolean dataDescriptorExists; + + private boolean writeComprSizeInZip64ExtraRecord; + + private boolean fileNameUTF8Encoded; + + public LocalFileHeader() { + encryptionMethod = -1; + writeComprSizeInZip64ExtraRecord = false; + crc32 = 0; + uncompressedSize = 0; + } + + public int getSignature() { + return signature; + } + + public void setSignature(int signature) { + this.signature = signature; + } + + public int getVersionNeededToExtract() { + return versionNeededToExtract; + } + + public void setVersionNeededToExtract(int versionNeededToExtract) { + this.versionNeededToExtract = versionNeededToExtract; + } + + public byte[] getGeneralPurposeFlag() { + return generalPurposeFlag; + } + + public void setGeneralPurposeFlag(byte[] generalPurposeFlag) { + this.generalPurposeFlag = generalPurposeFlag; + } + + public int getCompressionMethod() { + return compressionMethod; + } + + public void setCompressionMethod(int compressionMethod) { + this.compressionMethod = compressionMethod; + } + + public int getLastModFileTime() { + return lastModFileTime; + } + + public void setLastModFileTime(int lastModFileTime) { + this.lastModFileTime = lastModFileTime; + } + + public long getCrc32() { + return crc32; + } + + public void setCrc32(long crc32) { + this.crc32 = crc32; + } + + public long getCompressedSize() { + return compressedSize; + } + + public void setCompressedSize(long compressedSize) { + this.compressedSize = compressedSize; + } + + public long getUncompressedSize() { + return uncompressedSize; + } + + public void setUncompressedSize(long uncompressedSize) { + this.uncompressedSize = uncompressedSize; + } + + public int getFileNameLength() { + return fileNameLength; + } + + public void setFileNameLength(int fileNameLength) { + this.fileNameLength = fileNameLength; + } + + public int getExtraFieldLength() { + return extraFieldLength; + } + + public void setExtraFieldLength(int extraFieldLength) { + this.extraFieldLength = extraFieldLength; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public byte[] getExtraField() { + return extraField; + } + + public void setExtraField(byte[] extraField) { + this.extraField = extraField; + } + + public long getOffsetStartOfData() { + return offsetStartOfData; + } + + public void setOffsetStartOfData(long offsetStartOfData) { + this.offsetStartOfData = offsetStartOfData; + } + + public boolean isEncrypted() { + return isEncrypted; + } + + public void setEncrypted(boolean isEncrypted) { + this.isEncrypted = isEncrypted; + } + + public int getEncryptionMethod() { + return encryptionMethod; + } + + public void setEncryptionMethod(int encryptionMethod) { + this.encryptionMethod = encryptionMethod; + } + + public byte[] getCrcBuff() { + return crcBuff; + } + + public void setCrcBuff(byte[] crcBuff) { + this.crcBuff = crcBuff; + } + + public char[] getPassword() { + return password; + } + + public void setPassword(char[] password) { + this.password = password; + } + + public ArrayList getExtraDataRecords() { + return extraDataRecords; + } + + public void setExtraDataRecords(ArrayList extraDataRecords) { + this.extraDataRecords = extraDataRecords; + } + + public boolean isDataDescriptorExists() { + return dataDescriptorExists; + } + + public void setDataDescriptorExists(boolean dataDescriptorExists) { + this.dataDescriptorExists = dataDescriptorExists; + } + + public Zip64ExtendedInfo getZip64ExtendedInfo() { + return zip64ExtendedInfo; + } + + public void setZip64ExtendedInfo(Zip64ExtendedInfo zip64ExtendedInfo) { + this.zip64ExtendedInfo = zip64ExtendedInfo; + } + + public AESExtraDataRecord getAesExtraDataRecord() { + return aesExtraDataRecord; + } + + public void setAesExtraDataRecord(AESExtraDataRecord aesExtraDataRecord) { + this.aesExtraDataRecord = aesExtraDataRecord; + } + + public boolean isWriteComprSizeInZip64ExtraRecord() { + return writeComprSizeInZip64ExtraRecord; + } + + public void setWriteComprSizeInZip64ExtraRecord( + boolean writeComprSizeInZip64ExtraRecord) { + this.writeComprSizeInZip64ExtraRecord = writeComprSizeInZip64ExtraRecord; + } + + public boolean isFileNameUTF8Encoded() { + return fileNameUTF8Encoded; + } + + public void setFileNameUTF8Encoded(boolean fileNameUTF8Encoded) { + this.fileNameUTF8Encoded = fileNameUTF8Encoded; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/UnzipEngineParameters.java b/lib/zip4j/src/net/lingala/zip4j/model/UnzipEngineParameters.java new file mode 100644 index 00000000..12ff2713 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/UnzipEngineParameters.java @@ -0,0 +1,88 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +import java.io.FileOutputStream; + +import net.lingala.zip4j.crypto.IDecrypter; +import net.lingala.zip4j.unzip.UnzipEngine; + +public class UnzipEngineParameters { + + private ZipModel zipModel; + + private FileHeader fileHeader; + + private LocalFileHeader localFileHeader; + + private IDecrypter iDecryptor; + + private FileOutputStream outputStream; + + private UnzipEngine unzipEngine; + + public ZipModel getZipModel() { + return zipModel; + } + + public void setZipModel(ZipModel zipModel) { + this.zipModel = zipModel; + } + + public FileHeader getFileHeader() { + return fileHeader; + } + + public void setFileHeader(FileHeader fileHeader) { + this.fileHeader = fileHeader; + } + + public LocalFileHeader getLocalFileHeader() { + return localFileHeader; + } + + public void setLocalFileHeader(LocalFileHeader localFileHeader) { + this.localFileHeader = localFileHeader; + } + + public IDecrypter getIDecryptor() { + return iDecryptor; + } + + public void setIDecryptor(IDecrypter decrypter) { + iDecryptor = decrypter; + } + + public FileOutputStream getOutputStream() { + return outputStream; + } + + public void setOutputStream(FileOutputStream outputStream) { + this.outputStream = outputStream; + } + + public UnzipEngine getUnzipEngine() { + return unzipEngine; + } + + public void setUnzipEngine(UnzipEngine unzipEngine) { + this.unzipEngine = unzipEngine; + } + + + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/UnzipParameters.java b/lib/zip4j/src/net/lingala/zip4j/model/UnzipParameters.java new file mode 100644 index 00000000..050efe3c --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/UnzipParameters.java @@ -0,0 +1,77 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class UnzipParameters { + + private boolean ignoreReadOnlyFileAttribute; + private boolean ignoreHiddenFileAttribute; + private boolean ignoreArchiveFileAttribute; + private boolean ignoreSystemFileAttribute; + private boolean ignoreAllFileAttributes; + private boolean ignoreDateTimeAttributes; + + public boolean isIgnoreReadOnlyFileAttribute() { + return ignoreReadOnlyFileAttribute; + } + + public void setIgnoreReadOnlyFileAttribute(boolean ignoreReadOnlyFileAttribute) { + this.ignoreReadOnlyFileAttribute = ignoreReadOnlyFileAttribute; + } + + public boolean isIgnoreHiddenFileAttribute() { + return ignoreHiddenFileAttribute; + } + + public void setIgnoreHiddenFileAttribute(boolean ignoreHiddenFileAttribute) { + this.ignoreHiddenFileAttribute = ignoreHiddenFileAttribute; + } + + public boolean isIgnoreArchiveFileAttribute() { + return ignoreArchiveFileAttribute; + } + + public void setIgnoreArchiveFileAttribute(boolean ignoreArchiveFileAttribute) { + this.ignoreArchiveFileAttribute = ignoreArchiveFileAttribute; + } + + public boolean isIgnoreSystemFileAttribute() { + return ignoreSystemFileAttribute; + } + + public void setIgnoreSystemFileAttribute(boolean ignoreSystemFileAttribute) { + this.ignoreSystemFileAttribute = ignoreSystemFileAttribute; + } + + public boolean isIgnoreAllFileAttributes() { + return ignoreAllFileAttributes; + } + + public void setIgnoreAllFileAttributes(boolean ignoreAllFileAttributes) { + this.ignoreAllFileAttributes = ignoreAllFileAttributes; + } + + public boolean isIgnoreDateTimeAttributes() { + return ignoreDateTimeAttributes; + } + + public void setIgnoreDateTimeAttributes(boolean ignoreDateTimeAttributes) { + this.ignoreDateTimeAttributes = ignoreDateTimeAttributes; + } + + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/Zip64EndCentralDirLocator.java b/lib/zip4j/src/net/lingala/zip4j/model/Zip64EndCentralDirLocator.java new file mode 100644 index 00000000..fcc1e3d8 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/Zip64EndCentralDirLocator.java @@ -0,0 +1,64 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class Zip64EndCentralDirLocator { + + private long signature; + + private int noOfDiskStartOfZip64EndOfCentralDirRec; + + private long offsetZip64EndOfCentralDirRec; + + private int totNumberOfDiscs; + + public long getSignature() { + return signature; + } + + public void setSignature(long signature) { + this.signature = signature; + } + + public int getNoOfDiskStartOfZip64EndOfCentralDirRec() { + return noOfDiskStartOfZip64EndOfCentralDirRec; + } + + public void setNoOfDiskStartOfZip64EndOfCentralDirRec( + int noOfDiskStartOfZip64EndOfCentralDirRec) { + this.noOfDiskStartOfZip64EndOfCentralDirRec = noOfDiskStartOfZip64EndOfCentralDirRec; + } + + public long getOffsetZip64EndOfCentralDirRec() { + return offsetZip64EndOfCentralDirRec; + } + + public void setOffsetZip64EndOfCentralDirRec(long offsetZip64EndOfCentralDirRec) { + this.offsetZip64EndOfCentralDirRec = offsetZip64EndOfCentralDirRec; + } + + public int getTotNumberOfDiscs() { + return totNumberOfDiscs; + } + + public void setTotNumberOfDiscs(int totNumberOfDiscs) { + this.totNumberOfDiscs = totNumberOfDiscs; + } + + + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/Zip64EndCentralDirRecord.java b/lib/zip4j/src/net/lingala/zip4j/model/Zip64EndCentralDirRecord.java new file mode 100644 index 00000000..48da9b4b --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/Zip64EndCentralDirRecord.java @@ -0,0 +1,135 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class Zip64EndCentralDirRecord { + + private long signature; + + private long sizeOfZip64EndCentralDirRec; + + private int versionMadeBy; + + private int versionNeededToExtract; + + private int noOfThisDisk; + + private int noOfThisDiskStartOfCentralDir; + + private long totNoOfEntriesInCentralDirOnThisDisk; + + private long totNoOfEntriesInCentralDir; + + private long sizeOfCentralDir; + + private long offsetStartCenDirWRTStartDiskNo; + + private byte[] extensibleDataSector; + + public long getSignature() { + return signature; + } + + public void setSignature(long signature) { + this.signature = signature; + } + + public long getSizeOfZip64EndCentralDirRec() { + return sizeOfZip64EndCentralDirRec; + } + + public void setSizeOfZip64EndCentralDirRec(long sizeOfZip64EndCentralDirRec) { + this.sizeOfZip64EndCentralDirRec = sizeOfZip64EndCentralDirRec; + } + + public int getVersionMadeBy() { + return versionMadeBy; + } + + public void setVersionMadeBy(int versionMadeBy) { + this.versionMadeBy = versionMadeBy; + } + + public int getVersionNeededToExtract() { + return versionNeededToExtract; + } + + public void setVersionNeededToExtract(int versionNeededToExtract) { + this.versionNeededToExtract = versionNeededToExtract; + } + + public int getNoOfThisDisk() { + return noOfThisDisk; + } + + public void setNoOfThisDisk(int noOfThisDisk) { + this.noOfThisDisk = noOfThisDisk; + } + + public int getNoOfThisDiskStartOfCentralDir() { + return noOfThisDiskStartOfCentralDir; + } + + public void setNoOfThisDiskStartOfCentralDir(int noOfThisDiskStartOfCentralDir) { + this.noOfThisDiskStartOfCentralDir = noOfThisDiskStartOfCentralDir; + } + + public long getTotNoOfEntriesInCentralDirOnThisDisk() { + return totNoOfEntriesInCentralDirOnThisDisk; + } + + public void setTotNoOfEntriesInCentralDirOnThisDisk( + long totNoOfEntriesInCentralDirOnThisDisk) { + this.totNoOfEntriesInCentralDirOnThisDisk = totNoOfEntriesInCentralDirOnThisDisk; + } + + public long getTotNoOfEntriesInCentralDir() { + return totNoOfEntriesInCentralDir; + } + + public void setTotNoOfEntriesInCentralDir(long totNoOfEntriesInCentralDir) { + this.totNoOfEntriesInCentralDir = totNoOfEntriesInCentralDir; + } + + public long getSizeOfCentralDir() { + return sizeOfCentralDir; + } + + public void setSizeOfCentralDir(long sizeOfCentralDir) { + this.sizeOfCentralDir = sizeOfCentralDir; + } + + public long getOffsetStartCenDirWRTStartDiskNo() { + return offsetStartCenDirWRTStartDiskNo; + } + + public void setOffsetStartCenDirWRTStartDiskNo( + long offsetStartCenDirWRTStartDiskNo) { + this.offsetStartCenDirWRTStartDiskNo = offsetStartCenDirWRTStartDiskNo; + } + + public byte[] getExtensibleDataSector() { + return extensibleDataSector; + } + + public void setExtensibleDataSector(byte[] extensibleDataSector) { + this.extensibleDataSector = extensibleDataSector; + } + + + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/Zip64ExtendedInfo.java b/lib/zip4j/src/net/lingala/zip4j/model/Zip64ExtendedInfo.java new file mode 100644 index 00000000..f58d1e9d --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/Zip64ExtendedInfo.java @@ -0,0 +1,90 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +public class Zip64ExtendedInfo { + + private int header; + + private int size; + + private long compressedSize; + + private long unCompressedSize; + + private long offsetLocalHeader; + + private int diskNumberStart; + + public Zip64ExtendedInfo() { + compressedSize = -1; + unCompressedSize = -1; + offsetLocalHeader = -1; + diskNumberStart = -1; + } + + public int getHeader() { + return header; + } + + public void setHeader(int header) { + this.header = header; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public long getCompressedSize() { + return compressedSize; + } + + public void setCompressedSize(long compressedSize) { + this.compressedSize = compressedSize; + } + + public long getUnCompressedSize() { + return unCompressedSize; + } + + public void setUnCompressedSize(long unCompressedSize) { + this.unCompressedSize = unCompressedSize; + } + + public long getOffsetLocalHeader() { + return offsetLocalHeader; + } + + public void setOffsetLocalHeader(long offsetLocalHeader) { + this.offsetLocalHeader = offsetLocalHeader; + } + + public int getDiskNumberStart() { + return diskNumberStart; + } + + public void setDiskNumberStart(int diskNumberStart) { + this.diskNumberStart = diskNumberStart; + } + + + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/ZipModel.java b/lib/zip4j/src/net/lingala/zip4j/model/ZipModel.java new file mode 100644 index 00000000..85a5afa8 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/ZipModel.java @@ -0,0 +1,184 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +import java.util.List; + +public class ZipModel implements Cloneable { + + private List localFileHeaderList; + + private List dataDescriptorList; + + private ArchiveExtraDataRecord archiveExtraDataRecord; + + private CentralDirectory centralDirectory; + + private EndCentralDirRecord endCentralDirRecord; + + private Zip64EndCentralDirLocator zip64EndCentralDirLocator; + + private Zip64EndCentralDirRecord zip64EndCentralDirRecord; + + private boolean splitArchive; + + private long splitLength; + + private String zipFile; + + private boolean isZip64Format; + + private boolean isNestedZipFile; + + private long start; + + private long end; + + private String fileNameCharset; + + public ZipModel() { + splitLength = -1; + } + + public List getLocalFileHeaderList() { + return localFileHeaderList; + } + + public void setLocalFileHeaderList(List localFileHeaderList) { + this.localFileHeaderList = localFileHeaderList; + } + + public List getDataDescriptorList() { + return dataDescriptorList; + } + + public void setDataDescriptorList(List dataDescriptorList) { + this.dataDescriptorList = dataDescriptorList; + } + + public CentralDirectory getCentralDirectory() { + return centralDirectory; + } + + public void setCentralDirectory(CentralDirectory centralDirectory) { + this.centralDirectory = centralDirectory; + } + + public EndCentralDirRecord getEndCentralDirRecord() { + return endCentralDirRecord; + } + + public void setEndCentralDirRecord(EndCentralDirRecord endCentralDirRecord) { + this.endCentralDirRecord = endCentralDirRecord; + } + + public ArchiveExtraDataRecord getArchiveExtraDataRecord() { + return archiveExtraDataRecord; + } + + public void setArchiveExtraDataRecord( + ArchiveExtraDataRecord archiveExtraDataRecord) { + this.archiveExtraDataRecord = archiveExtraDataRecord; + } + + public boolean isSplitArchive() { + return splitArchive; + } + + public void setSplitArchive(boolean splitArchive) { + this.splitArchive = splitArchive; + } + + public String getZipFile() { + return zipFile; + } + + public void setZipFile(String zipFile) { + this.zipFile = zipFile; + } + + public Zip64EndCentralDirLocator getZip64EndCentralDirLocator() { + return zip64EndCentralDirLocator; + } + + public void setZip64EndCentralDirLocator( + Zip64EndCentralDirLocator zip64EndCentralDirLocator) { + this.zip64EndCentralDirLocator = zip64EndCentralDirLocator; + } + + public Zip64EndCentralDirRecord getZip64EndCentralDirRecord() { + return zip64EndCentralDirRecord; + } + + public void setZip64EndCentralDirRecord( + Zip64EndCentralDirRecord zip64EndCentralDirRecord) { + this.zip64EndCentralDirRecord = zip64EndCentralDirRecord; + } + + public boolean isZip64Format() { + return isZip64Format; + } + + public void setZip64Format(boolean isZip64Format) { + this.isZip64Format = isZip64Format; + } + + public boolean isNestedZipFile() { + return isNestedZipFile; + } + + public void setNestedZipFile(boolean isNestedZipFile) { + this.isNestedZipFile = isNestedZipFile; + } + + public long getStart() { + return start; + } + + public void setStart(long start) { + this.start = start; + } + + public long getEnd() { + return end; + } + + public void setEnd(long end) { + this.end = end; + } + + public long getSplitLength() { + return splitLength; + } + + public void setSplitLength(long splitLength) { + this.splitLength = splitLength; + } + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + public String getFileNameCharset() { + return fileNameCharset; + } + + public void setFileNameCharset(String fileNameCharset) { + this.fileNameCharset = fileNameCharset; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/model/ZipParameters.java b/lib/zip4j/src/net/lingala/zip4j/model/ZipParameters.java new file mode 100644 index 00000000..166be750 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/model/ZipParameters.java @@ -0,0 +1,195 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.model; + +import java.util.TimeZone; + +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jConstants; +import net.lingala.zip4j.util.Zip4jUtil; + +public class ZipParameters implements Cloneable { + + private int compressionMethod; + private int compressionLevel; + private boolean encryptFiles; + private int encryptionMethod; + private boolean readHiddenFiles; + private char[] password; + private int aesKeyStrength; + private boolean includeRootFolder; + private String rootFolderInZip; + private TimeZone timeZone; + private int sourceFileCRC; + private String defaultFolderPath; + private String fileNameInZip; + private boolean isSourceExternalStream; + + public ZipParameters() { + compressionMethod = Zip4jConstants.COMP_DEFLATE; + encryptFiles = false; + readHiddenFiles = true; + encryptionMethod = Zip4jConstants.ENC_NO_ENCRYPTION; + aesKeyStrength = -1; + includeRootFolder = true; + timeZone = TimeZone.getDefault(); + } + + public int getCompressionMethod() { + return compressionMethod; + } + + public void setCompressionMethod(int compressionMethod) { + this.compressionMethod = compressionMethod; + } + + public boolean isEncryptFiles() { + return encryptFiles; + } + + public void setEncryptFiles(boolean encryptFiles) { + this.encryptFiles = encryptFiles; + } + + public int getEncryptionMethod() { + return encryptionMethod; + } + + public void setEncryptionMethod(int encryptionMethod) { + this.encryptionMethod = encryptionMethod; + } + + public int getCompressionLevel() { + return compressionLevel; + } + + public void setCompressionLevel(int compressionLevel) { + this.compressionLevel = compressionLevel; + } + + public boolean isReadHiddenFiles() { + return readHiddenFiles; + } + + public void setReadHiddenFiles(boolean readHiddenFiles) { + this.readHiddenFiles = readHiddenFiles; + } + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + public char[] getPassword() { + return password; + } + + /** + * Sets the password for the zip file or the file being added
+ * Note: For security reasons, usage of this method is discouraged. Use + * setPassword(char[]) instead. As strings are immutable, they cannot be wiped + * out from memory explicitly after usage. Therefore, usage of Strings to store + * passwords is discouraged. More info here: + * http://docs.oracle.com/javase/1.5.0/docs/guide/security/jce/JCERefGuide.html#PBEEx + * @param password + */ + public void setPassword(String password) { + if (password == null) return; + setPassword(password.toCharArray()); + } + + public void setPassword(char[] password) { + this.password = password; + } + + public int getAesKeyStrength() { + return aesKeyStrength; + } + + public void setAesKeyStrength(int aesKeyStrength) { + this.aesKeyStrength = aesKeyStrength; + } + + public boolean isIncludeRootFolder() { + return includeRootFolder; + } + + public void setIncludeRootFolder(boolean includeRootFolder) { + this.includeRootFolder = includeRootFolder; + } + + public String getRootFolderInZip() { + return rootFolderInZip; + } + + public void setRootFolderInZip(String rootFolderInZip) { + if (Zip4jUtil.isStringNotNullAndNotEmpty(rootFolderInZip)) { + + if (!rootFolderInZip.endsWith("\\") && !rootFolderInZip.endsWith("/")) { + rootFolderInZip = rootFolderInZip + InternalZipConstants.FILE_SEPARATOR; + } + + rootFolderInZip = rootFolderInZip.replaceAll("\\\\", "/"); + +// if (rootFolderInZip.endsWith("/")) { +// rootFolderInZip = rootFolderInZip.substring(0, rootFolderInZip.length() - 1); +// rootFolderInZip = rootFolderInZip + "\\"; +// } + } + this.rootFolderInZip = rootFolderInZip; + } + + public TimeZone getTimeZone() { + return timeZone; + } + + public void setTimeZone(TimeZone timeZone) { + this.timeZone = timeZone; + } + + public int getSourceFileCRC() { + return sourceFileCRC; + } + + public void setSourceFileCRC(int sourceFileCRC) { + this.sourceFileCRC = sourceFileCRC; + } + + public String getDefaultFolderPath() { + return defaultFolderPath; + } + + public void setDefaultFolderPath(String defaultFolderPath) { + this.defaultFolderPath = defaultFolderPath; + } + + public String getFileNameInZip() { + return fileNameInZip; + } + + public void setFileNameInZip(String fileNameInZip) { + this.fileNameInZip = fileNameInZip; + } + + public boolean isSourceExternalStream() { + return isSourceExternalStream; + } + + public void setSourceExternalStream(boolean isSourceExternalStream) { + this.isSourceExternalStream = isSourceExternalStream; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/progress/ProgressMonitor.java b/lib/zip4j/src/net/lingala/zip4j/progress/ProgressMonitor.java new file mode 100644 index 00000000..1e123f9e --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/progress/ProgressMonitor.java @@ -0,0 +1,180 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.progress; + +import net.lingala.zip4j.exception.ZipException; + +/** + * If Zip4j is set to run in thread mode, this class helps retrieve current progress + * + */ +public class ProgressMonitor { + + private int state; + private long totalWork; + private long workCompleted; + private int percentDone; + private int currentOperation; + private String fileName; + private int result; + private Throwable exception; + private boolean cancelAllTasks; + private boolean pause; + + //Progress monitor States + public static final int STATE_READY = 0; + public static final int STATE_BUSY = 1; + + //Progress monitor result codes + public static final int RESULT_SUCCESS = 0; + public static final int RESULT_WORKING = 1; + public static final int RESULT_ERROR = 2; + public static final int RESULT_CANCELLED = 3; + + //Operation Types + public static final int OPERATION_NONE = -1; + public static final int OPERATION_ADD = 0; + public static final int OPERATION_EXTRACT = 1; + public static final int OPERATION_REMOVE = 2; + public static final int OPERATION_CALC_CRC = 3; + public static final int OPERATION_MERGE = 4; + + public ProgressMonitor() { + reset(); + percentDone = 0; + } + + public int getState() { + return state; + } + + public void setState(int state) { + this.state = state; + } + + public long getTotalWork() { + return totalWork; + } + + public void setTotalWork(long totalWork) { + this.totalWork = totalWork; + } + + public long getWorkCompleted() { + return workCompleted; + } + + public void updateWorkCompleted(long workCompleted) { + this.workCompleted += workCompleted; + + if (totalWork > 0) { + percentDone = (int)((this.workCompleted*100/totalWork)); + if (percentDone > 100) { + percentDone = 100; + } + } + while (pause) { + try { + Thread.sleep(150); + } catch (InterruptedException e) { + //Do nothing + } + } + } + + public int getPercentDone() { + return percentDone; + } + + public void setPercentDone(int percentDone) { + this.percentDone = percentDone; + } + + public int getResult() { + return result; + } + + public void setResult(int result) { + this.result = result; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public int getCurrentOperation() { + return currentOperation; + } + + public void setCurrentOperation(int currentOperation) { + this.currentOperation = currentOperation; + } + + public Throwable getException() { + return exception; + } + + public void setException(Throwable exception) { + this.exception = exception; + } + + public void endProgressMonitorSuccess() throws ZipException { + reset(); + result = ProgressMonitor.RESULT_SUCCESS; + } + + public void endProgressMonitorError(Throwable e) throws ZipException { + reset(); + result = ProgressMonitor.RESULT_ERROR; + exception = e; + } + + public void reset() { + currentOperation = OPERATION_NONE; + state = STATE_READY; + fileName = null; + totalWork = 0; + workCompleted = 0; + percentDone = 0; + } + + public void fullReset() { + reset(); + exception = null; + result = RESULT_SUCCESS; + } + + public boolean isCancelAllTasks() { + return cancelAllTasks; + } + + public void cancelAllTasks() { + this.cancelAllTasks = true; + } + + public boolean isPause() { + return pause; + } + + public void setPause(boolean pause) { + this.pause = pause; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/unzip/Unzip.java b/lib/zip4j/src/net/lingala/zip4j/unzip/Unzip.java new file mode 100644 index 00000000..fc9f70b8 --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/unzip/Unzip.java @@ -0,0 +1,231 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.unzip; + +import java.io.File; +import java.util.ArrayList; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.io.ZipInputStream; +import net.lingala.zip4j.model.CentralDirectory; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.UnzipParameters; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.progress.ProgressMonitor; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jUtil; + +public class Unzip { + + private ZipModel zipModel; + + public Unzip(ZipModel zipModel) throws ZipException { + + if (zipModel == null) { + throw new ZipException("ZipModel is null"); + } + + this.zipModel = zipModel; + } + + public void extractAll(final UnzipParameters unzipParameters, final String outPath, + final ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + + CentralDirectory centralDirectory = zipModel.getCentralDirectory(); + + if (centralDirectory == null || + centralDirectory.getFileHeaders() == null) { + throw new ZipException("invalid central directory in zipModel"); + } + + final ArrayList fileHeaders = centralDirectory.getFileHeaders(); + + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_EXTRACT); + progressMonitor.setTotalWork(calculateTotalWork(fileHeaders)); + progressMonitor.setState(ProgressMonitor.STATE_BUSY); + + if (runInThread) { + Thread thread = new Thread(InternalZipConstants.THREAD_NAME) { + public void run() { + try { + initExtractAll(fileHeaders, unzipParameters, progressMonitor, outPath); + progressMonitor.endProgressMonitorSuccess(); + } catch (ZipException e) { + } + } + }; + thread.start(); + } else { + initExtractAll(fileHeaders, unzipParameters, progressMonitor, outPath); + } + + } + + private void initExtractAll(ArrayList fileHeaders, UnzipParameters unzipParameters, + ProgressMonitor progressMonitor, String outPath) throws ZipException { + + for (int i = 0; i < fileHeaders.size(); i++) { + FileHeader fileHeader = (FileHeader)fileHeaders.get(i); + initExtractFile(fileHeader, outPath, unzipParameters, null, progressMonitor); + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + } + } + + public void extractFile(final FileHeader fileHeader, final String outPath, + final UnzipParameters unzipParameters, final String newFileName, + final ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + if (fileHeader == null) { + throw new ZipException("fileHeader is null"); + } + + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_EXTRACT); + progressMonitor.setTotalWork(fileHeader.getCompressedSize()); + progressMonitor.setState(ProgressMonitor.STATE_BUSY); + progressMonitor.setPercentDone(0); + progressMonitor.setFileName(fileHeader.getFileName()); + + if (runInThread) { + Thread thread = new Thread(InternalZipConstants.THREAD_NAME) { + public void run() { + try { + initExtractFile(fileHeader, outPath, unzipParameters, newFileName, progressMonitor); + progressMonitor.endProgressMonitorSuccess(); + } catch (ZipException e) { + } + } + }; + thread.start(); + } else { + initExtractFile(fileHeader, outPath, unzipParameters, newFileName, progressMonitor); + progressMonitor.endProgressMonitorSuccess(); + } + + } + + private void initExtractFile(FileHeader fileHeader, String outPath, + UnzipParameters unzipParameters, String newFileName, ProgressMonitor progressMonitor) throws ZipException { + + if (fileHeader == null) { + throw new ZipException("fileHeader is null"); + } + + try { + progressMonitor.setFileName(fileHeader.getFileName()); + + if (!outPath.endsWith(InternalZipConstants.FILE_SEPARATOR)) { + outPath += InternalZipConstants.FILE_SEPARATOR; + } + + // If file header is a directory, then check if the directory exists + // If not then create a directory and return + if (fileHeader.isDirectory()) { + try { + String fileName = fileHeader.getFileName(); + if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) { + return; + } + String completePath = outPath + fileName; + File file = new File(completePath); + if (!file.exists()) { + file.mkdirs(); + } + } catch (Exception e) { + progressMonitor.endProgressMonitorError(e); + throw new ZipException(e); + } + } else { + //Create Directories + checkOutputDirectoryStructure(fileHeader, outPath, newFileName); + + UnzipEngine unzipEngine = new UnzipEngine(zipModel, fileHeader); + try { + unzipEngine.unzipFile(progressMonitor, outPath, newFileName, unzipParameters); + } catch (Exception e) { + progressMonitor.endProgressMonitorError(e); + throw new ZipException(e); + } + } + } catch (ZipException e) { + progressMonitor.endProgressMonitorError(e); + throw e; + } catch (Exception e) { + progressMonitor.endProgressMonitorError(e); + throw new ZipException(e); + } + } + + public ZipInputStream getInputStream(FileHeader fileHeader) throws ZipException { + UnzipEngine unzipEngine = new UnzipEngine(zipModel, fileHeader); + return unzipEngine.getInputStream(); + } + + private void checkOutputDirectoryStructure(FileHeader fileHeader, String outPath, String newFileName) throws ZipException { + if (fileHeader == null || !Zip4jUtil.isStringNotNullAndNotEmpty(outPath)) { + throw new ZipException("Cannot check output directory structure...one of the parameters was null"); + } + + String fileName = fileHeader.getFileName(); + + if (Zip4jUtil.isStringNotNullAndNotEmpty(newFileName)) { + fileName = newFileName; + } + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) { + // Do nothing + return; + } + + String compOutPath = outPath + fileName; + try { + File file = new File(compOutPath); + String parentDir = file.getParent(); + File parentDirFile = new File(parentDir); + if (!parentDirFile.exists()) { + parentDirFile.mkdirs(); + } + } catch (Exception e) { + throw new ZipException(e); + } + } + + private long calculateTotalWork(ArrayList fileHeaders) throws ZipException { + + if (fileHeaders == null) { + throw new ZipException("fileHeaders is null, cannot calculate total work"); + } + + long totalWork = 0; + + for (int i = 0; i < fileHeaders.size(); i++) { + FileHeader fileHeader = (FileHeader)fileHeaders.get(i); + if (fileHeader.getZip64ExtendedInfo() != null && + fileHeader.getZip64ExtendedInfo().getUnCompressedSize() > 0) { + totalWork += fileHeader.getZip64ExtendedInfo().getCompressedSize(); + } else { + totalWork += fileHeader.getCompressedSize(); + } + + } + + return totalWork; + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/unzip/UnzipEngine.java b/lib/zip4j/src/net/lingala/zip4j/unzip/UnzipEngine.java new file mode 100644 index 00000000..772e141a --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/unzip/UnzipEngine.java @@ -0,0 +1,521 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.unzip; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.RandomAccessFile; +import java.util.Arrays; +import java.util.zip.CRC32; + +import net.lingala.zip4j.core.HeaderReader; +import net.lingala.zip4j.crypto.AESDecrypter; +import net.lingala.zip4j.crypto.IDecrypter; +import net.lingala.zip4j.crypto.StandardDecrypter; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.io.InflaterInputStream; +import net.lingala.zip4j.io.PartInputStream; +import net.lingala.zip4j.io.ZipInputStream; +import net.lingala.zip4j.model.AESExtraDataRecord; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.LocalFileHeader; +import net.lingala.zip4j.model.UnzipParameters; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.progress.ProgressMonitor; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Raw; +import net.lingala.zip4j.util.Zip4jConstants; +import net.lingala.zip4j.util.Zip4jUtil; + +public class UnzipEngine { + + private ZipModel zipModel; + private FileHeader fileHeader; + private int currSplitFileCounter = 0; + private LocalFileHeader localFileHeader; + private IDecrypter decrypter; + private CRC32 crc; + + public UnzipEngine(ZipModel zipModel, FileHeader fileHeader) throws ZipException { + if (zipModel == null || fileHeader == null) { + throw new ZipException("Invalid parameters passed to StoreUnzip. One or more of the parameters were null"); + } + + this.zipModel = zipModel; + this.fileHeader = fileHeader; + this.crc = new CRC32(); + } + + public void unzipFile(ProgressMonitor progressMonitor, + String outPath, String newFileName, UnzipParameters unzipParameters) throws ZipException { + if (zipModel == null || fileHeader == null || !Zip4jUtil.isStringNotNullAndNotEmpty(outPath)) { + throw new ZipException("Invalid parameters passed during unzipping file. One or more of the parameters were null"); + } + InputStream is = null; + OutputStream os = null; + try { + byte[] buff = new byte[InternalZipConstants.BUFF_SIZE]; + int readLength = -1; + + is = getInputStream(); + os = getOutputStream(outPath, newFileName); + + while ((readLength = is.read(buff)) != -1) { + os.write(buff, 0, readLength); + progressMonitor.updateWorkCompleted(readLength); + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + } + + closeStreams(is, os); + + UnzipUtil.applyFileAttributes(fileHeader, new File(getOutputFileNameWithPath(outPath, newFileName)), unzipParameters); + + } catch (IOException e) { + throw new ZipException(e); + } catch (Exception e) { + throw new ZipException(e); + } finally { + closeStreams(is, os); + } + } + + public ZipInputStream getInputStream() throws ZipException { + if (fileHeader == null) { + throw new ZipException("file header is null, cannot get inputstream"); + } + + RandomAccessFile raf = null; + try { + raf = createFileHandler(InternalZipConstants.READ_MODE); + String errMsg = "local header and file header do not match"; + //checkSplitFile(); + + if (!checkLocalHeader()) + throw new ZipException(errMsg); + + init(raf); + + long comprSize = localFileHeader.getCompressedSize(); + long offsetStartOfData = localFileHeader.getOffsetStartOfData(); + + if (localFileHeader.isEncrypted()) { + if (localFileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + if (decrypter instanceof AESDecrypter) { + comprSize -= (((AESDecrypter)decrypter).getSaltLength() + + ((AESDecrypter)decrypter).getPasswordVerifierLength() + 10); + offsetStartOfData += (((AESDecrypter)decrypter).getSaltLength() + + ((AESDecrypter)decrypter).getPasswordVerifierLength()); + } else { + throw new ZipException("invalid decryptor when trying to calculate " + + "compressed size for AES encrypted file: " + fileHeader.getFileName()); + } + } else if (localFileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + comprSize -= InternalZipConstants.STD_DEC_HDR_SIZE; + offsetStartOfData += InternalZipConstants.STD_DEC_HDR_SIZE; + } + } + + int compressionMethod = fileHeader.getCompressionMethod(); + if (fileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + if (fileHeader.getAesExtraDataRecord() != null) { + compressionMethod = fileHeader.getAesExtraDataRecord().getCompressionMethod(); + } else { + throw new ZipException("AESExtraDataRecord does not exist for AES encrypted file: " + fileHeader.getFileName()); + } + } + raf.seek(offsetStartOfData); + switch (compressionMethod) { + case Zip4jConstants.COMP_STORE: + return new ZipInputStream(new PartInputStream(raf, offsetStartOfData, comprSize, this)); + case Zip4jConstants.COMP_DEFLATE: + return new ZipInputStream(new InflaterInputStream(raf, offsetStartOfData, comprSize, this)); + default: + throw new ZipException("compression type not supported"); + } + } catch (ZipException e) { + if (raf != null) { + try { + raf.close(); + } catch (IOException e1) { + //ignore + } + } + throw e; + } catch (Exception e) { + if (raf != null) { + try { + raf.close(); + } catch (IOException e1) { + } + } + throw new ZipException(e); + } + + } + + private void init(RandomAccessFile raf) throws ZipException { + + if (localFileHeader == null) { + throw new ZipException("local file header is null, cannot initialize input stream"); + } + + try { + initDecrypter(raf); + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void initDecrypter(RandomAccessFile raf) throws ZipException { + if (localFileHeader == null) { + throw new ZipException("local file header is null, cannot init decrypter"); + } + + if (localFileHeader.isEncrypted()) { + if (localFileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + decrypter = new StandardDecrypter(fileHeader, getStandardDecrypterHeaderBytes(raf)); + } else if (localFileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + decrypter = new AESDecrypter(localFileHeader, getAESSalt(raf), getAESPasswordVerifier(raf)); + } else { + throw new ZipException("unsupported encryption method"); + } + } + } + + private byte[] getStandardDecrypterHeaderBytes(RandomAccessFile raf) throws ZipException { + try { + byte[] headerBytes = new byte[InternalZipConstants.STD_DEC_HDR_SIZE]; + raf.seek(localFileHeader.getOffsetStartOfData()); + raf.read(headerBytes, 0, 12); + return headerBytes; + } catch (IOException e) { + throw new ZipException(e); + } catch (Exception e) { + throw new ZipException(e); + } + } + + private byte[] getAESSalt(RandomAccessFile raf) throws ZipException { + if (localFileHeader.getAesExtraDataRecord() == null) + return null; + + try { + AESExtraDataRecord aesExtraDataRecord = localFileHeader.getAesExtraDataRecord(); + byte[] saltBytes = new byte[calculateAESSaltLength(aesExtraDataRecord)]; + raf.seek(localFileHeader.getOffsetStartOfData()); + raf.read(saltBytes); + return saltBytes; + } catch (IOException e) { + throw new ZipException(e); + } + } + + private byte[] getAESPasswordVerifier(RandomAccessFile raf) throws ZipException { + try { + byte[] pvBytes = new byte[2]; + raf.read(pvBytes); + return pvBytes; + } catch (IOException e) { + throw new ZipException(e); + } + } + + private int calculateAESSaltLength(AESExtraDataRecord aesExtraDataRecord) throws ZipException { + if (aesExtraDataRecord == null) { + throw new ZipException("unable to determine salt length: AESExtraDataRecord is null"); + } + switch (aesExtraDataRecord.getAesStrength()) { + case Zip4jConstants.AES_STRENGTH_128: + return 8; + case Zip4jConstants.AES_STRENGTH_192: + return 12; + case Zip4jConstants.AES_STRENGTH_256: + return 16; + default: + throw new ZipException("unable to determine salt length: invalid aes key strength"); + } + } + + public void checkCRC() throws ZipException { + if (fileHeader != null) { + if (fileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { + if (decrypter != null && decrypter instanceof AESDecrypter) { + byte[] tmpMacBytes = ((AESDecrypter)decrypter).getCalculatedAuthenticationBytes(); + byte[] storedMac = ((AESDecrypter)decrypter).getStoredMac(); + byte[] calculatedMac = new byte[InternalZipConstants.AES_AUTH_LENGTH]; + + if (calculatedMac == null || storedMac == null) { + throw new ZipException("CRC (MAC) check failed for " + fileHeader.getFileName()); + } + + System.arraycopy(tmpMacBytes, 0, calculatedMac, 0, InternalZipConstants.AES_AUTH_LENGTH); + + if (!Arrays.equals(calculatedMac, storedMac)) { + throw new ZipException("invalid CRC (MAC) for file: " + fileHeader.getFileName()); + } + } + } else { + long calculatedCRC = crc.getValue() & 0xffffffffL; + if (calculatedCRC != fileHeader.getCrc32()) { + String errMsg = "invalid CRC for file: " + fileHeader.getFileName(); + if (localFileHeader.isEncrypted() && + localFileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + errMsg += " - Wrong Password?"; + } + throw new ZipException(errMsg); + } + } + } + } + +// private void checkCRC() throws ZipException { +// if (fileHeader != null) { +// if (fileHeader.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_AES) { +// if (decrypter != null && decrypter instanceof AESDecrypter) { +// byte[] tmpMacBytes = ((AESDecrypter)decrypter).getCalculatedAuthenticationBytes(); +// byte[] actualMacBytes = ((AESDecrypter)decrypter).getStoredMac(); +// if (tmpMacBytes == null || actualMacBytes == null) { +// throw new ZipException("null mac value for AES encrypted file: " + fileHeader.getFileName()); +// } +// byte[] calcMacBytes = new byte[10]; +// System.arraycopy(tmpMacBytes, 0, calcMacBytes, 0, 10); +// if (!Arrays.equals(calcMacBytes, actualMacBytes)) { +// throw new ZipException("invalid CRC(mac) for file: " + fileHeader.getFileName()); +// } +// } else { +// throw new ZipException("invalid decryptor...cannot calculate mac value for file: " +// + fileHeader.getFileName()); +// } +// } else if (unzipEngine != null) { +// long calculatedCRC = unzipEngine.getCRC(); +// long actualCRC = fileHeader.getCrc32(); +// if (calculatedCRC != actualCRC) { +// throw new ZipException("invalid CRC for file: " + fileHeader.getFileName()); +// } +// } +// } +// } + + private boolean checkLocalHeader() throws ZipException { + RandomAccessFile rafForLH = null; + try { + rafForLH = checkSplitFile(); + + if (rafForLH == null) { + rafForLH = new RandomAccessFile(new File(this.zipModel.getZipFile()), InternalZipConstants.READ_MODE); + } + + HeaderReader headerReader = new HeaderReader(rafForLH); + this.localFileHeader = headerReader.readLocalFileHeader(fileHeader); + + if (localFileHeader == null) { + throw new ZipException("error reading local file header. Is this a valid zip file?"); + } + + //TODO Add more comparision later + if (localFileHeader.getCompressionMethod() != fileHeader.getCompressionMethod()) { + return false; + } + + return true; + } catch (FileNotFoundException e) { + throw new ZipException(e); + } finally { + if (rafForLH != null) { + try { + rafForLH.close(); + } catch (IOException e) { + // Ignore this + } catch (Exception e) { + //Ignore this + } + } + } + } + + private RandomAccessFile checkSplitFile() throws ZipException { + if (zipModel.isSplitArchive()) { + int diskNumberStartOfFile = fileHeader.getDiskNumberStart(); + currSplitFileCounter = diskNumberStartOfFile + 1; + String curZipFile = zipModel.getZipFile(); + String partFile = null; + if (diskNumberStartOfFile == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) { + partFile = zipModel.getZipFile(); + } else { + if (diskNumberStartOfFile >= 9) { + partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z" + (diskNumberStartOfFile+ 1); + } else{ + partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z0" + (diskNumberStartOfFile+ 1); + } + } + + try { + RandomAccessFile raf = new RandomAccessFile(partFile, InternalZipConstants.READ_MODE); + + if (currSplitFileCounter == 1) { + byte[] splitSig = new byte[4]; + raf.read(splitSig); + if (Raw.readIntLittleEndian(splitSig, 0) != InternalZipConstants.SPLITSIG) { + throw new ZipException("invalid first part split file signature"); + } + } + return raf; + } catch (FileNotFoundException e) { + throw new ZipException(e); + } catch (IOException e) { + throw new ZipException(e); + } + } + return null; + } + + private RandomAccessFile createFileHandler(String mode) throws ZipException { + if (this.zipModel == null || !Zip4jUtil.isStringNotNullAndNotEmpty(this.zipModel.getZipFile())) { + throw new ZipException("input parameter is null in getFilePointer"); + } + + try { + RandomAccessFile raf = null; + if (zipModel.isSplitArchive()) { + raf = checkSplitFile(); + } else { + raf = new RandomAccessFile(new File(this.zipModel.getZipFile()), mode); + } + return raf; + } catch (FileNotFoundException e) { + throw new ZipException(e); + } catch (Exception e) { + throw new ZipException(e); + } + } + + private FileOutputStream getOutputStream(String outPath, String newFileName) throws ZipException { + if (!Zip4jUtil.isStringNotNullAndNotEmpty(outPath)) { + throw new ZipException("invalid output path"); + } + + try { + File file = new File(getOutputFileNameWithPath(outPath, newFileName)); + + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + + if (file.exists()) { + file.delete(); + } + + FileOutputStream fileOutputStream = new FileOutputStream(file); + return fileOutputStream; + } catch (FileNotFoundException e) { + throw new ZipException(e); + } + } + + private String getOutputFileNameWithPath(String outPath, String newFileName) throws ZipException { + String fileName = null; + if (Zip4jUtil.isStringNotNullAndNotEmpty(newFileName)) { + fileName = newFileName; + } else { + fileName = fileHeader.getFileName(); + } + return outPath + System.getProperty("file.separator") + fileName; + } + + public RandomAccessFile startNextSplitFile() throws IOException, FileNotFoundException { + String currZipFile = zipModel.getZipFile(); + String partFile = null; + if (currSplitFileCounter == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) { + partFile = zipModel.getZipFile(); + } else { + if (currSplitFileCounter >= 9) { + partFile = currZipFile.substring(0, currZipFile.lastIndexOf(".")) + ".z" + (currSplitFileCounter + 1); + } else { + partFile = currZipFile.substring(0, currZipFile.lastIndexOf(".")) + ".z0" + (currSplitFileCounter + 1); + } + } + currSplitFileCounter++; + try { + if(!Zip4jUtil.checkFileExists(partFile)) { + throw new IOException("zip split file does not exist: " + partFile); + } + } catch (ZipException e) { + throw new IOException(e.getMessage()); + } + return new RandomAccessFile(partFile, InternalZipConstants.READ_MODE); + } + + private void closeStreams(InputStream is, OutputStream os) throws ZipException { + try { + if (is != null) { + is.close(); + is = null; + } + } catch (IOException e) { + if (e != null && Zip4jUtil.isStringNotNullAndNotEmpty(e.getMessage())) { + if (e.getMessage().indexOf(" - Wrong Password?") >= 0) { + throw new ZipException(e.getMessage()); + } + } + } finally { + try { + if (os != null) { + os.close(); + os = null; + } + } catch (IOException e) { + //do nothing + } + } + } + + public void updateCRC(int b) { + crc.update(b); + } + + public void updateCRC(byte[] buff, int offset, int len) { + if (buff != null) { + crc.update(buff, offset, len); + } + } + + public FileHeader getFileHeader() { + return fileHeader; + } + + public IDecrypter getDecrypter() { + return decrypter; + } + + public ZipModel getZipModel() { + return zipModel; + } + + public LocalFileHeader getLocalFileHeader() { + return localFileHeader; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/unzip/UnzipUtil.java b/lib/zip4j/src/net/lingala/zip4j/unzip/UnzipUtil.java new file mode 100644 index 00000000..fde8566f --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/unzip/UnzipUtil.java @@ -0,0 +1,113 @@ +package net.lingala.zip4j.unzip; + +import java.io.File; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.UnzipParameters; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jUtil; + +public class UnzipUtil { + + public static void applyFileAttributes(FileHeader fileHeader, File file) throws ZipException { + applyFileAttributes(fileHeader, file, null); + } + + public static void applyFileAttributes(FileHeader fileHeader, File file, + UnzipParameters unzipParameters) throws ZipException{ + + if (fileHeader == null) { + throw new ZipException("cannot set file properties: file header is null"); + } + + if (file == null) { + throw new ZipException("cannot set file properties: output file is null"); + } + + if (!Zip4jUtil.checkFileExists(file)) { + throw new ZipException("cannot set file properties: file doesnot exist"); + } + + if (unzipParameters == null || !unzipParameters.isIgnoreDateTimeAttributes()) { + setFileLastModifiedTime(fileHeader, file); + } + + if (unzipParameters == null) { + setFileAttributes(fileHeader, file, true, true, true, true); + } else { + if (unzipParameters.isIgnoreAllFileAttributes()) { + setFileAttributes(fileHeader, file, false, false, false, false); + } else { + setFileAttributes(fileHeader, file, !unzipParameters.isIgnoreReadOnlyFileAttribute(), + !unzipParameters.isIgnoreHiddenFileAttribute(), + !unzipParameters.isIgnoreArchiveFileAttribute(), + !unzipParameters.isIgnoreSystemFileAttribute()); + } + } + } + + private static void setFileAttributes(FileHeader fileHeader, File file, boolean setReadOnly, + boolean setHidden, boolean setArchive, boolean setSystem) throws ZipException { + if (fileHeader == null) { + throw new ZipException("invalid file header. cannot set file attributes"); + } + + byte[] externalAttrbs = fileHeader.getExternalFileAttr(); + if (externalAttrbs == null) { + return; + } + + int atrrib = externalAttrbs[0]; + switch (atrrib) { + case InternalZipConstants.FILE_MODE_READ_ONLY: + if (setReadOnly) Zip4jUtil.setFileReadOnly(file); + break; + case InternalZipConstants.FILE_MODE_HIDDEN: + case InternalZipConstants.FOLDER_MODE_HIDDEN: + if (setHidden) Zip4jUtil.setFileHidden(file); + break; + case InternalZipConstants.FILE_MODE_ARCHIVE: + case InternalZipConstants.FOLDER_MODE_ARCHIVE: + if (setArchive) Zip4jUtil.setFileArchive(file); + break; + case InternalZipConstants.FILE_MODE_READ_ONLY_HIDDEN: + if (setReadOnly) Zip4jUtil.setFileReadOnly(file); + if (setHidden) Zip4jUtil.setFileHidden(file); + break; + case InternalZipConstants.FILE_MODE_READ_ONLY_ARCHIVE: + if (setArchive) Zip4jUtil.setFileArchive(file); + if (setReadOnly) Zip4jUtil.setFileReadOnly(file); + break; + case InternalZipConstants.FILE_MODE_HIDDEN_ARCHIVE: + case InternalZipConstants.FOLDER_MODE_HIDDEN_ARCHIVE: + if (setArchive) Zip4jUtil.setFileArchive(file); + if (setHidden) Zip4jUtil.setFileHidden(file); + break; + case InternalZipConstants.FILE_MODE_READ_ONLY_HIDDEN_ARCHIVE: + if (setArchive) Zip4jUtil.setFileArchive(file); + if (setReadOnly) Zip4jUtil.setFileReadOnly(file); + if (setHidden) Zip4jUtil.setFileHidden(file); + break; + case InternalZipConstants.FILE_MODE_SYSTEM: + if (setReadOnly) Zip4jUtil.setFileReadOnly(file); + if (setHidden) Zip4jUtil.setFileHidden(file); + if (setSystem) Zip4jUtil.setFileSystemMode(file); + break; + default: + //do nothing + break; + } + } + + private static void setFileLastModifiedTime(FileHeader fileHeader, File file) throws ZipException { + if (fileHeader.getLastModFileTime() <= 0) { + return; + } + + if (file.exists()) { + file.setLastModified(Zip4jUtil.dosToJavaTme(fileHeader.getLastModFileTime())); + } + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/util/ArchiveMaintainer.java b/lib/zip4j/src/net/lingala/zip4j/util/ArchiveMaintainer.java new file mode 100644 index 00000000..4659df5b --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/util/ArchiveMaintainer.java @@ -0,0 +1,727 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.util; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.RandomAccessFile; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.HashMap; + +import net.lingala.zip4j.core.HeaderReader; +import net.lingala.zip4j.core.HeaderWriter; +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.io.SplitOutputStream; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.LocalFileHeader; +import net.lingala.zip4j.model.Zip64EndCentralDirLocator; +import net.lingala.zip4j.model.Zip64EndCentralDirRecord; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.progress.ProgressMonitor; + +public class ArchiveMaintainer { + + public ArchiveMaintainer() { + } + + public HashMap removeZipFile(final ZipModel zipModel, + final FileHeader fileHeader, final ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + + if (runInThread) { + Thread thread = new Thread(InternalZipConstants.THREAD_NAME) { + public void run() { + try { + initRemoveZipFile(zipModel, fileHeader, progressMonitor); + progressMonitor.endProgressMonitorSuccess(); + } catch (ZipException e) { + } + } + }; + thread.start(); + return null; + } else { + HashMap retMap = initRemoveZipFile(zipModel, fileHeader, progressMonitor); + progressMonitor.endProgressMonitorSuccess(); + return retMap; + } + + } + + public HashMap initRemoveZipFile(ZipModel zipModel, + FileHeader fileHeader, ProgressMonitor progressMonitor) throws ZipException { + + if (fileHeader == null || zipModel == null) { + throw new ZipException("input parameters is null in maintain zip file, cannot remove file from archive"); + } + + OutputStream outputStream = null; + File zipFile = null; + RandomAccessFile inputStream = null; + boolean successFlag = false; + String tmpZipFileName = null; + HashMap retMap = new HashMap(); + + try { + int indexOfFileHeader = Zip4jUtil.getIndexOfFileHeader(zipModel, fileHeader); + + if (indexOfFileHeader < 0) { + throw new ZipException("file header not found in zip model, cannot remove file"); + } + + if (zipModel.isSplitArchive()) { + throw new ZipException("This is a split archive. Zip file format does not allow updating split/spanned files"); + } + + long currTime = System.currentTimeMillis(); + tmpZipFileName = zipModel.getZipFile() + currTime%1000; + File tmpFile = new File(tmpZipFileName); + + while (tmpFile.exists()) { + currTime = System.currentTimeMillis(); + tmpZipFileName = zipModel.getZipFile() + currTime%1000; + tmpFile = new File(tmpZipFileName); + } + + try { + outputStream = new SplitOutputStream(new File(tmpZipFileName)); + } catch (FileNotFoundException e1) { + throw new ZipException(e1); + } + + zipFile = new File(zipModel.getZipFile()); + + inputStream = createFileHandler(zipModel, InternalZipConstants.READ_MODE); + + HeaderReader headerReader = new HeaderReader(inputStream); + LocalFileHeader localFileHeader = headerReader.readLocalFileHeader(fileHeader); + if (localFileHeader == null) { + throw new ZipException("invalid local file header, cannot remove file from archive"); + } + + long offsetLocalFileHeader = fileHeader.getOffsetLocalHeader(); + + if (fileHeader.getZip64ExtendedInfo() != null && + fileHeader.getZip64ExtendedInfo().getOffsetLocalHeader() != -1) { + offsetLocalFileHeader = fileHeader.getZip64ExtendedInfo().getOffsetLocalHeader(); + } + + long offsetEndOfCompressedFile = -1; + + long offsetStartCentralDir = zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir(); + if (zipModel.isZip64Format()) { + if (zipModel.getZip64EndCentralDirRecord() != null) { + offsetStartCentralDir = zipModel.getZip64EndCentralDirRecord().getOffsetStartCenDirWRTStartDiskNo(); + } + } + + ArrayList fileHeaderList = zipModel.getCentralDirectory().getFileHeaders(); + + if (indexOfFileHeader == fileHeaderList.size() - 1) { + offsetEndOfCompressedFile = offsetStartCentralDir - 1; + } else { + FileHeader nextFileHeader = (FileHeader)fileHeaderList.get(indexOfFileHeader + 1); + if (nextFileHeader != null) { + offsetEndOfCompressedFile = nextFileHeader.getOffsetLocalHeader() - 1; + if (nextFileHeader.getZip64ExtendedInfo() != null && + nextFileHeader.getZip64ExtendedInfo().getOffsetLocalHeader() != -1) { + offsetEndOfCompressedFile = nextFileHeader.getZip64ExtendedInfo().getOffsetLocalHeader() - 1; + } + } + } + + if (offsetLocalFileHeader < 0 || offsetEndOfCompressedFile < 0) { + throw new ZipException("invalid offset for start and end of local file, cannot remove file"); + } + + if(indexOfFileHeader == 0) { + if (zipModel.getCentralDirectory().getFileHeaders().size() > 1) { + // if this is the only file and it is deleted then no need to do this + copyFile(inputStream, outputStream, offsetEndOfCompressedFile + 1, offsetStartCentralDir, progressMonitor); + } + } else if (indexOfFileHeader == fileHeaderList.size() - 1) { + copyFile(inputStream, outputStream, 0, offsetLocalFileHeader, progressMonitor); + } else { + copyFile(inputStream, outputStream, 0, offsetLocalFileHeader, progressMonitor); + copyFile(inputStream, outputStream, offsetEndOfCompressedFile + 1, offsetStartCentralDir, progressMonitor); + } + + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return null; + } + + zipModel.getEndCentralDirRecord().setOffsetOfStartOfCentralDir(((SplitOutputStream)outputStream).getFilePointer()); + zipModel.getEndCentralDirRecord().setTotNoOfEntriesInCentralDir( + zipModel.getEndCentralDirRecord().getTotNoOfEntriesInCentralDir() - 1); + zipModel.getEndCentralDirRecord().setTotNoOfEntriesInCentralDirOnThisDisk( + zipModel.getEndCentralDirRecord().getTotNoOfEntriesInCentralDirOnThisDisk() - 1); + + zipModel.getCentralDirectory().getFileHeaders().remove(indexOfFileHeader); + + for (int i = indexOfFileHeader; i < zipModel.getCentralDirectory().getFileHeaders().size(); i++) { + long offsetLocalHdr = ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).getOffsetLocalHeader(); + if (((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).getZip64ExtendedInfo() != null && + ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).getZip64ExtendedInfo().getOffsetLocalHeader() != -1) { + offsetLocalHdr = ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).getZip64ExtendedInfo().getOffsetLocalHeader(); + } + + ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).setOffsetLocalHeader( + offsetLocalHdr - (offsetEndOfCompressedFile - offsetLocalFileHeader) - 1); + } + + HeaderWriter headerWriter = new HeaderWriter(); + headerWriter.finalizeZipFile(zipModel, outputStream); + + successFlag = true; + + retMap.put(InternalZipConstants.OFFSET_CENTRAL_DIR, + Long.toString(zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir())); + + } catch (ZipException e) { + progressMonitor.endProgressMonitorError(e); + throw e; + } catch (Exception e) { + progressMonitor.endProgressMonitorError(e); + throw new ZipException(e); + } finally { + try { + if (inputStream != null) + inputStream.close(); + if (outputStream != null) + outputStream.close(); + } catch (IOException e) { + throw new ZipException("cannot close input stream or output stream when trying to delete a file from zip file"); + } + + if (successFlag) { + restoreFileName(zipFile, tmpZipFileName); + } else { + File newZipFile = new File(tmpZipFileName); + newZipFile.delete(); + } + } + + return retMap; + } + + private void restoreFileName(File zipFile, String tmpZipFileName) throws ZipException { + if (zipFile.delete()) + { + File newZipFile = new File(tmpZipFileName); + if (!newZipFile.renameTo(zipFile)) { + throw new ZipException("cannot rename modified zip file"); + } + } else { + throw new ZipException("cannot delete old zip file"); + } + } + + private void copyFile(RandomAccessFile inputStream, + OutputStream outputStream, long start, long end, ProgressMonitor progressMonitor) throws ZipException { + + if (inputStream == null || outputStream == null) { + throw new ZipException("input or output stream is null, cannot copy file"); + } + + if (start < 0) { + throw new ZipException("starting offset is negative, cannot copy file"); + } + + if (end < 0) { + throw new ZipException("end offset is negative, cannot copy file"); + } + + if (start > end) { + throw new ZipException("start offset is greater than end offset, cannot copy file"); + } + + if (start == end) { + return; + } + + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + + try { + inputStream.seek(start); + + int readLen = -2; + byte[] buff; + long bytesRead = 0; + long bytesToRead = end - start; + + if ((end - start) < InternalZipConstants.BUFF_SIZE) { + buff = new byte[(int)(end - start)]; + } else { + buff = new byte[InternalZipConstants.BUFF_SIZE]; + } + + while ((readLen = inputStream.read(buff)) != -1) { + outputStream.write(buff, 0, readLen); + + progressMonitor.updateWorkCompleted(readLen); + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + return; + } + + bytesRead += readLen; + + if(bytesRead == bytesToRead) { + break; + } else if (bytesRead + buff.length > bytesToRead) { + buff = new byte[(int)(bytesToRead - bytesRead)]; + } + } + + } catch (IOException e) { + throw new ZipException(e); + } catch (Exception e) { + throw new ZipException(e); + } + } + + private RandomAccessFile createFileHandler(ZipModel zipModel, String mode) throws ZipException { + if (zipModel == null || !Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getZipFile())) { + throw new ZipException("input parameter is null in getFilePointer, cannot create file handler to remove file"); + } + + try { + return new RandomAccessFile(new File(zipModel.getZipFile()), mode); + } catch (FileNotFoundException e) { + throw new ZipException(e); + } + } + + /** + * Merges split Zip files into a single Zip file + * @param zipModel + * @throws ZipException + */ + public void mergeSplitZipFiles(final ZipModel zipModel, final File outputZipFile, + final ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + if (runInThread) { + Thread thread = new Thread(InternalZipConstants.THREAD_NAME) { + public void run() { + try { + initMergeSplitZipFile(zipModel, outputZipFile, progressMonitor); + } catch (ZipException e) { + } + } + }; + thread.start(); + } else { + initMergeSplitZipFile(zipModel, outputZipFile, progressMonitor); + } + } + + private void initMergeSplitZipFile(ZipModel zipModel, File outputZipFile, + ProgressMonitor progressMonitor) throws ZipException { + if (zipModel == null) { + ZipException e = new ZipException("one of the input parameters is null, cannot merge split zip file"); + progressMonitor.endProgressMonitorError(e); + throw e; + } + + if (!zipModel.isSplitArchive()) { + ZipException e = new ZipException("archive not a split zip file"); + progressMonitor.endProgressMonitorError(e); + throw e; + } + + OutputStream outputStream = null; + RandomAccessFile inputStream = null; + ArrayList fileSizeList = new ArrayList(); + long totBytesWritten = 0; + boolean splitSigRemoved = false; + try { + + int totNoOfSplitFiles = zipModel.getEndCentralDirRecord().getNoOfThisDisk(); + + if (totNoOfSplitFiles <= 0) { + throw new ZipException("corrupt zip model, archive not a split zip file"); + } + + outputStream = prepareOutputStreamForMerge(outputZipFile); + for (int i = 0; i <= totNoOfSplitFiles; i++) { + inputStream = createSplitZipFileHandler(zipModel, i); + + int start = 0; + Long end = new Long(inputStream.length()); + + if (i == 0) { + if (zipModel.getCentralDirectory() != null && + zipModel.getCentralDirectory().getFileHeaders() != null && + zipModel.getCentralDirectory().getFileHeaders().size() > 0) { + byte[] buff = new byte[4]; + inputStream.seek(0); + inputStream.read(buff); + if (Raw.readIntLittleEndian(buff, 0) == InternalZipConstants.SPLITSIG) { + start = 4; + splitSigRemoved = true; + } + } + } + + if (i == totNoOfSplitFiles) { + end = new Long(zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir()); + } + + copyFile(inputStream, outputStream, start, end.longValue(), progressMonitor); + totBytesWritten += (end.longValue() - start); + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + + fileSizeList.add(end); + + try { + inputStream.close(); + } catch (IOException e) { + //ignore + } + } + + ZipModel newZipModel = (ZipModel)zipModel.clone(); + newZipModel.getEndCentralDirRecord().setOffsetOfStartOfCentralDir(totBytesWritten); + + updateSplitZipModel(newZipModel, fileSizeList, splitSigRemoved); + + HeaderWriter headerWriter = new HeaderWriter(); + headerWriter.finalizeZipFileWithoutValidations(newZipModel, outputStream); + + progressMonitor.endProgressMonitorSuccess(); + + } catch (IOException e) { + progressMonitor.endProgressMonitorError(e); + throw new ZipException(e); + } catch (Exception e) { + progressMonitor.endProgressMonitorError(e); + throw new ZipException(e); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + //ignore + } + } + + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + // ignore + } + } + } + } + + /** + * Creates an input stream for the split part of the zip file + * @return Zip4jInputStream + * @throws ZipException + */ + + private RandomAccessFile createSplitZipFileHandler(ZipModel zipModel, int partNumber) throws ZipException { + if (zipModel == null) { + throw new ZipException("zip model is null, cannot create split file handler"); + } + + if (partNumber < 0) { + throw new ZipException("invlaid part number, cannot create split file handler"); + } + + try { + String curZipFile = zipModel.getZipFile(); + String partFile = null; + if (partNumber == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) { + partFile = zipModel.getZipFile(); + } else { + if (partNumber >= 9) { + partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z" + (partNumber+ 1); + } else{ + partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z0" + (partNumber+ 1); + } + } + File tmpFile = new File(partFile); + + if (!Zip4jUtil.checkFileExists(tmpFile)) { + throw new ZipException("split file does not exist: " + partFile); + } + + return new RandomAccessFile(tmpFile, InternalZipConstants.READ_MODE); + } catch (FileNotFoundException e) { + throw new ZipException(e); + } catch (Exception e) { + throw new ZipException(e); + } + + } + + private OutputStream prepareOutputStreamForMerge(File outFile) throws ZipException { + if (outFile == null) { + throw new ZipException("outFile is null, cannot create outputstream"); + } + + try { + return new FileOutputStream(outFile); + } catch (FileNotFoundException e) { + throw new ZipException(e); + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void updateSplitZipModel(ZipModel zipModel, ArrayList fileSizeList, boolean splitSigRemoved) throws ZipException { + if (zipModel == null) { + throw new ZipException("zip model is null, cannot update split zip model"); + } + + zipModel.setSplitArchive(false); + updateSplitFileHeader(zipModel, fileSizeList, splitSigRemoved); + updateSplitEndCentralDirectory(zipModel); + if (zipModel.isZip64Format()) { + updateSplitZip64EndCentralDirLocator(zipModel, fileSizeList); + updateSplitZip64EndCentralDirRec(zipModel, fileSizeList); + } + } + + private void updateSplitFileHeader(ZipModel zipModel, ArrayList fileSizeList, boolean splitSigRemoved) throws ZipException { + try { + + if (zipModel.getCentralDirectory()== null) { + throw new ZipException("corrupt zip model - getCentralDirectory, cannot update split zip model"); + } + + int fileHeaderCount = zipModel.getCentralDirectory().getFileHeaders().size(); + int splitSigOverhead = 0; + if (splitSigRemoved) + splitSigOverhead = 4; + + for (int i = 0; i < fileHeaderCount; i++) { + long offsetLHToAdd = 0; + + for (int j = 0; j < ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).getDiskNumberStart(); j++) { + offsetLHToAdd += ((Long)fileSizeList.get(j)).longValue(); + } + ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).setOffsetLocalHeader( + ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).getOffsetLocalHeader() + + offsetLHToAdd - splitSigOverhead); + ((FileHeader)zipModel.getCentralDirectory().getFileHeaders().get(i)).setDiskNumberStart(0); + } + + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void updateSplitEndCentralDirectory(ZipModel zipModel) throws ZipException { + try { + if (zipModel == null) { + throw new ZipException("zip model is null - cannot update end of central directory for split zip model"); + } + + if (zipModel.getCentralDirectory()== null) { + throw new ZipException("corrupt zip model - getCentralDirectory, cannot update split zip model"); + } + + zipModel.getEndCentralDirRecord().setNoOfThisDisk(0); + zipModel.getEndCentralDirRecord().setNoOfThisDiskStartOfCentralDir(0); + zipModel.getEndCentralDirRecord().setTotNoOfEntriesInCentralDir( + zipModel.getCentralDirectory().getFileHeaders().size()); + zipModel.getEndCentralDirRecord().setTotNoOfEntriesInCentralDirOnThisDisk( + zipModel.getCentralDirectory().getFileHeaders().size()); + + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } + } + + private void updateSplitZip64EndCentralDirLocator(ZipModel zipModel, ArrayList fileSizeList) throws ZipException { + if (zipModel == null) { + throw new ZipException("zip model is null, cannot update split Zip64 end of central directory locator"); + } + + if (zipModel.getZip64EndCentralDirLocator() == null) { + return; + } + + zipModel.getZip64EndCentralDirLocator().setNoOfDiskStartOfZip64EndOfCentralDirRec(0); + long offsetZip64EndCentralDirRec = 0; + + for (int i = 0; i < fileSizeList.size(); i++) { + offsetZip64EndCentralDirRec += ((Long)fileSizeList.get(i)).longValue(); + } + zipModel.getZip64EndCentralDirLocator().setOffsetZip64EndOfCentralDirRec( + ((Zip64EndCentralDirLocator)zipModel.getZip64EndCentralDirLocator()).getOffsetZip64EndOfCentralDirRec() + + offsetZip64EndCentralDirRec); + zipModel.getZip64EndCentralDirLocator().setTotNumberOfDiscs(1); + } + + private void updateSplitZip64EndCentralDirRec(ZipModel zipModel, ArrayList fileSizeList) throws ZipException { + if (zipModel == null) { + throw new ZipException("zip model is null, cannot update split Zip64 end of central directory record"); + } + + if (zipModel.getZip64EndCentralDirRecord() == null) { + return; + } + + zipModel.getZip64EndCentralDirRecord().setNoOfThisDisk(0); + zipModel.getZip64EndCentralDirRecord().setNoOfThisDiskStartOfCentralDir(0); + zipModel.getZip64EndCentralDirRecord().setTotNoOfEntriesInCentralDirOnThisDisk( + zipModel.getEndCentralDirRecord().getTotNoOfEntriesInCentralDir()); + + long offsetStartCenDirWRTStartDiskNo = 0; + + for (int i = 0; i < fileSizeList.size(); i++) { + offsetStartCenDirWRTStartDiskNo += ((Long)fileSizeList.get(i)).longValue(); + } + + zipModel.getZip64EndCentralDirRecord().setOffsetStartCenDirWRTStartDiskNo( + ((Zip64EndCentralDirRecord)zipModel.getZip64EndCentralDirRecord()).getOffsetStartCenDirWRTStartDiskNo() + + offsetStartCenDirWRTStartDiskNo); + } + + public void setComment(ZipModel zipModel, String comment) throws ZipException { + if (comment == null) { + throw new ZipException("comment is null, cannot update Zip file with comment"); + } + + if (zipModel == null) { + throw new ZipException("zipModel is null, cannot update Zip file with comment"); + } + + String encodedComment = comment; + byte[] commentBytes = comment.getBytes(); + int commentLength = comment.length(); + + if (Zip4jUtil.isSupportedCharset(InternalZipConstants.CHARSET_COMMENTS_DEFAULT)) { + try { + encodedComment = new String(comment.getBytes(InternalZipConstants.CHARSET_COMMENTS_DEFAULT), InternalZipConstants.CHARSET_COMMENTS_DEFAULT); + commentBytes = encodedComment.getBytes(InternalZipConstants.CHARSET_COMMENTS_DEFAULT); + commentLength = encodedComment.length(); + } catch (UnsupportedEncodingException e) { + encodedComment = comment; + commentBytes = comment.getBytes(); + commentLength = comment.length(); + } + } + + if (commentLength > InternalZipConstants.MAX_ALLOWED_ZIP_COMMENT_LENGTH) { + throw new ZipException("comment length exceeds maximum length"); + } + + zipModel.getEndCentralDirRecord().setComment(encodedComment); + zipModel.getEndCentralDirRecord().setCommentBytes(commentBytes); + zipModel.getEndCentralDirRecord().setCommentLength(commentLength); + + SplitOutputStream outputStream = null; + + try { + HeaderWriter headerWriter = new HeaderWriter(); + outputStream = new SplitOutputStream(zipModel.getZipFile()); + + if (zipModel.isZip64Format()) { + outputStream.seek(zipModel.getZip64EndCentralDirRecord().getOffsetStartCenDirWRTStartDiskNo()); + } else { + outputStream.seek(zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir()); + } + + headerWriter.finalizeZipFileWithoutValidations(zipModel, outputStream); + } catch (FileNotFoundException e) { + throw new ZipException(e); + } catch (IOException e) { + throw new ZipException(e); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + //ignore + } + } + } + } + + public void initProgressMonitorForRemoveOp(ZipModel zipModel, + FileHeader fileHeader, ProgressMonitor progressMonitor) throws ZipException { + if (zipModel == null || fileHeader == null || progressMonitor == null) { + throw new ZipException("one of the input parameters is null, cannot calculate total work"); + } + + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_REMOVE); + progressMonitor.setFileName(fileHeader.getFileName()); + progressMonitor.setTotalWork(calculateTotalWorkForRemoveOp(zipModel, fileHeader)); + progressMonitor.setState(ProgressMonitor.STATE_BUSY); + } + + private long calculateTotalWorkForRemoveOp(ZipModel zipModel, FileHeader fileHeader) throws ZipException { + return Zip4jUtil.getFileLengh(new File(zipModel.getZipFile())) - fileHeader.getCompressedSize(); + } + + public void initProgressMonitorForMergeOp(ZipModel zipModel, ProgressMonitor progressMonitor) throws ZipException { + if (zipModel == null) { + throw new ZipException("zip model is null, cannot calculate total work for merge op"); + } + + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_MERGE); + progressMonitor.setFileName(zipModel.getZipFile()); + progressMonitor.setTotalWork(calculateTotalWorkForMergeOp(zipModel)); + progressMonitor.setState(ProgressMonitor.STATE_BUSY); + } + + private long calculateTotalWorkForMergeOp(ZipModel zipModel) throws ZipException { + long totSize = 0; + if (zipModel.isSplitArchive()) { + int totNoOfSplitFiles = zipModel.getEndCentralDirRecord().getNoOfThisDisk(); + String partFile = null; + String curZipFile = zipModel.getZipFile(); + int partNumber = 0; + for (int i = 0; i <= totNoOfSplitFiles; i++) { + if (partNumber == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) { + partFile = zipModel.getZipFile(); + } else { + if (partNumber >= 9) { + partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z" + (partNumber+ 1); + } else{ + partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z0" + (partNumber+ 1); + } + } + + totSize += Zip4jUtil.getFileLengh(new File(partFile)); + } + + } + return totSize; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/util/CRCUtil.java b/lib/zip4j/src/net/lingala/zip4j/util/CRCUtil.java new file mode 100644 index 00000000..0f30068a --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/util/CRCUtil.java @@ -0,0 +1,85 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.CRC32; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.progress.ProgressMonitor; + +public class CRCUtil { + + private static final int BUF_SIZE = 1 << 14; //16384 + + public static long computeFileCRC(String inputFile) throws ZipException { + return computeFileCRC(inputFile, null); + } + + /** + * Calculates CRC of a file + * @param inputFile - file for which crc has to be calculated + * @return crc of the file + * @throws ZipException + */ + public static long computeFileCRC(String inputFile, ProgressMonitor progressMonitor) throws ZipException { + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(inputFile)) { + throw new ZipException("input file is null or empty, cannot calculate CRC for the file"); + } + InputStream inputStream = null; + try { + Zip4jUtil.checkFileReadAccess(inputFile); + + inputStream = new FileInputStream(new File(inputFile)); + + byte[] buff = new byte[BUF_SIZE]; + int readLen = -2; + CRC32 crc32 = new CRC32(); + + while ((readLen = inputStream.read(buff)) != -1) { + crc32.update(buff, 0, readLen); + if (progressMonitor != null) { + progressMonitor.updateWorkCompleted(readLen); + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return 0; + } + } + } + + return crc32.getValue(); + } catch (IOException e) { + throw new ZipException(e); + } catch (Exception e) { + throw new ZipException(e); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + throw new ZipException("error while closing the file after calculating crc"); + } + } + } + } + +} diff --git a/lib/zip4j/src/net/lingala/zip4j/util/InternalZipConstants.java b/lib/zip4j/src/net/lingala/zip4j/util/InternalZipConstants.java new file mode 100644 index 00000000..143b259e --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/util/InternalZipConstants.java @@ -0,0 +1,174 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.util; + +public interface InternalZipConstants { + + /* + * Header signatures + */ + // Whenever a new Signature is added here, make sure to add it + // in Zip4jUtil.getAllHeaderSignatures() + static long LOCSIG = 0x04034b50L; // "PK\003\004" + static long EXTSIG = 0x08074b50L; // "PK\007\008" + static long CENSIG = 0x02014b50L; // "PK\001\002" + static long ENDSIG = 0x06054b50L; // "PK\005\006" + static long DIGSIG = 0x05054b50L; + static long ARCEXTDATREC = 0x08064b50L; + static long SPLITSIG = 0x08074b50L; + static long ZIP64ENDCENDIRLOC = 0x07064b50L; + static long ZIP64ENDCENDIRREC = 0x06064b50; + static int EXTRAFIELDZIP64LENGTH = 0x0001; + static int AESSIG = 0x9901; + + /* + * Header sizes in bytes (including signatures) + */ + static final int LOCHDR = 30; // LOC header size + static final int EXTHDR = 16; // EXT header size + static final int CENHDR = 46; // CEN header size + static final int ENDHDR = 22; // END header size + + /* + * Local file (LOC) header field offsets + */ + static final int LOCVER = 4; // version needed to extract + static final int LOCFLG = 6; // general purpose bit flag + static final int LOCHOW = 8; // compression method + static final int LOCTIM = 10; // modification time + static final int LOCCRC = 14; // uncompressed file crc-32 value + static final int LOCSIZ = 18; // compressed size + static final int LOCLEN = 22; // uncompressed size + static final int LOCNAM = 26; // filename length + static final int LOCEXT = 28; // extra field length + + /* + * Extra local (EXT) header field offsets + */ + static final int EXTCRC = 4; // uncompressed file crc-32 value + static final int EXTSIZ = 8; // compressed size + static final int EXTLEN = 12; // uncompressed size + + /* + * Central directory (CEN) header field offsets + */ + static final int CENVEM = 4; // version made by + static final int CENVER = 6; // version needed to extract + static final int CENFLG = 8; // encrypt, decrypt flags + static final int CENHOW = 10; // compression method + static final int CENTIM = 12; // modification time + static final int CENCRC = 16; // uncompressed file crc-32 value + static final int CENSIZ = 20; // compressed size + static final int CENLEN = 24; // uncompressed size + static final int CENNAM = 28; // filename length + static final int CENEXT = 30; // extra field length + static final int CENCOM = 32; // comment length + static final int CENDSK = 34; // disk number start + static final int CENATT = 36; // internal file attributes + static final int CENATX = 38; // external file attributes + static final int CENOFF = 42; // LOC header offset + + /* + * End of central directory (END) header field offsets + */ + static final int ENDSUB = 8; // number of entries on this disk + static final int ENDTOT = 10; // total number of entries + static final int ENDSIZ = 12; // central directory size in bytes + static final int ENDOFF = 16; // offset of first CEN header + static final int ENDCOM = 20; // zip file comment length + + static final int STD_DEC_HDR_SIZE = 12; + + //AES Constants + static final int AES_AUTH_LENGTH = 10; + static final int AES_BLOCK_SIZE = 16; + + static final int MIN_SPLIT_LENGTH = 65536; + + static final long ZIP_64_LIMIT = 4294967295L; + + public static String OFFSET_CENTRAL_DIR = "offsetCentralDir"; + + public static final String VERSION = "1.3.2"; + + public static final int MODE_ZIP = 1; + + public static final int MODE_UNZIP = 2; + + public static final String WRITE_MODE = "rw"; + + public static final String READ_MODE = "r"; + + public static final int BUFF_SIZE = 1024 * 4; + + public static final int FILE_MODE_NONE = 0; + + public static final int FILE_MODE_READ_ONLY = 1; + + public static final int FILE_MODE_HIDDEN = 2; + + public static final int FILE_MODE_ARCHIVE = 32; + + public static final int FILE_MODE_READ_ONLY_HIDDEN = 3; + + public static final int FILE_MODE_READ_ONLY_ARCHIVE = 33; + + public static final int FILE_MODE_HIDDEN_ARCHIVE = 34; + + public static final int FILE_MODE_READ_ONLY_HIDDEN_ARCHIVE = 35; + + public static final int FILE_MODE_SYSTEM = 38; + + public static final int FOLDER_MODE_NONE = 16; + + public static final int FOLDER_MODE_HIDDEN = 18; + + public static final int FOLDER_MODE_ARCHIVE = 48; + + public static final int FOLDER_MODE_HIDDEN_ARCHIVE = 50; + + // Update local file header constants + // This value holds the number of bytes to skip from + // the offset of start of local header + public static final int UPDATE_LFH_CRC = 14; + + public static final int UPDATE_LFH_COMP_SIZE = 18; + + public static final int UPDATE_LFH_UNCOMP_SIZE = 22; + + public static final int LIST_TYPE_FILE = 1; + + public static final int LIST_TYPE_STRING = 2; + + public static final int UFT8_NAMES_FLAG = 1 << 11; + + public static final String CHARSET_UTF8 = "UTF8"; + + public static final String CHARSET_CP850 = "Cp850"; + + public static final String CHARSET_COMMENTS_DEFAULT = "windows-1254"; + + public static final String CHARSET_DEFAULT = System.getProperty("file.encoding"); + + public static final String FILE_SEPARATOR = System.getProperty("file.separator"); + + public static final String ZIP_FILE_SEPARATOR = "/"; + + public static final String THREAD_NAME = "Zip4j"; + + public static final int MAX_ALLOWED_ZIP_COMMENT_LENGTH = 0xFFFF; +} diff --git a/lib/zip4j/src/net/lingala/zip4j/util/Raw.java b/lib/zip4j/src/net/lingala/zip4j/util/Raw.java new file mode 100644 index 00000000..b043b70a --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/util/Raw.java @@ -0,0 +1,184 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.util; + +import java.io.DataInput; +import java.io.IOException; + +import net.lingala.zip4j.exception.ZipException; + +public class Raw +{ + public static long readLongLittleEndian(byte[] array,int pos){ + long temp = 0; + temp |= array[pos+7]&0xff; + temp <<=8; + temp |= array[pos+6]&0xff; + temp <<=8; + temp |= array[pos+5]&0xff; + temp <<=8; + temp |= array[pos+4]&0xff; + temp <<=8; + temp |= array[pos+3]&0xff; + temp <<=8; + temp |= array[pos+2]&0xff; + temp <<=8; + temp |= array[pos+1]&0xff; + temp <<=8; + temp |= array[pos]&0xff; + return temp; + } + + public static int readLeInt(DataInput di, byte[] b) throws ZipException{ + try { + di.readFully(b, 0, 4); + } catch (IOException e) { + throw new ZipException(e); + } + return ((b[0] & 0xff) | (b[1] & 0xff) << 8) + | ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16; + } + + public static int readShortLittleEndian(byte[] b, int off){ + return (b[off] & 0xff) | (b[off+1] & 0xff) << 8; + } + + public static final short readShortBigEndian(byte[] array, int pos) { + short temp = 0; + temp |= array[pos] & 0xff; + temp <<= 8; + temp |= array[pos + 1] & 0xff; + return temp; + } + + public static int readIntLittleEndian(byte[] b, int off){ + return ((b[off] & 0xff) | (b[off+1] & 0xff) << 8) + | ((b[off+2] & 0xff) | (b[off+3] & 0xff) << 8) << 16; + } + + public static byte[] toByteArray(int in,int outSize) { + byte[] out = new byte[outSize]; + byte[] intArray = toByteArray(in); + for( int i=0; i> 8); + out[2] = (byte)(in >> 16); + out[3] = (byte)(in >> 24); + + return out; + } + + public static final void writeShortLittleEndian(byte[] array, int pos, + short value) { + array[pos +1] = (byte) (value >>> 8); + array[pos ] = (byte) (value & 0xFF); + + } + + public static final void writeIntLittleEndian(byte[] array, int pos,int value) { + array[pos+3] = (byte) (value >>>24); + array[pos+2] = (byte) (value >>>16); + array[pos+1] = (byte) (value >>>8); + array[pos] = (byte) (value &0xFF); + + } + + public static void writeLongLittleEndian(byte[] array, int pos, long value){ + array[pos+7] = (byte) (value >>>56); + array[pos+6] = (byte) (value >>>48); + array[pos+5] = (byte) (value >>>40); + array[pos+4] = (byte) (value >>>32); + array[pos+3] = (byte) (value >>>24); + array[pos+2] = (byte) (value >>>16); + array[pos+1] = (byte) (value >>>8); + array[pos] = (byte) (value &0xFF); + } + + public static byte bitArrayToByte(int[] bitArray) throws ZipException { + if (bitArray == null) { + throw new ZipException("bit array is null, cannot calculate byte from bits"); + } + + if (bitArray.length != 8) { + throw new ZipException("invalid bit array length, cannot calculate byte"); + } + + if(!checkBits(bitArray)) { + throw new ZipException("invalid bits provided, bits contain other values than 0 or 1"); + } + + int retNum = 0; + for (int i = 0; i < bitArray.length; i++) { + retNum += Math.pow(2, i) * bitArray[i]; + } + + return (byte)retNum; + } + + private static boolean checkBits(int[] bitArray) { + for (int i = 0; i < bitArray.length; i++) { + if (bitArray[i] != 0 && bitArray[i] != 1) { + return false; + } + } + return true; + } + + public static void prepareBuffAESIVBytes(byte[] buff, int nonce, int length) { + buff[0] = (byte)nonce; + buff[1] = (byte)(nonce >> 8); + buff[2] = (byte)(nonce >> 16); + buff[3] = (byte)(nonce >> 24); + buff[4] = 0; + buff[5] = 0; + buff[6] = 0; + buff[7] = 0; + buff[8] = 0; + buff[9] = 0; + buff[10] = 0; + buff[11] = 0; + buff[12] = 0; + buff[13] = 0; + buff[14] = 0; + buff[15] = 0; + } + + /** + * Converts a char array to byte array + * @param charArray + * @return byte array representation of the input char array + */ + public static byte[] convertCharArrayToByteArray(char[] charArray) { + if (charArray == null) { + throw new NullPointerException(); + } + + byte[] bytes = new byte[charArray.length]; + for(int i=0;i= 0); + } + + public static void setFileReadOnly(File file) throws ZipException { + if (file == null) { + throw new ZipException("input file is null. cannot set read only file attribute"); + } + + if (file.exists()) { + file.setReadOnly(); + } + } + + public static void setFileHidden(File file) throws ZipException { +// if (file == null) { +// throw new ZipException("input file is null. cannot set hidden file attribute"); +// } +// +// if (!isWindows()) { +// return; +// } +// +// if (file.exists()) { +// try { +// Runtime.getRuntime().exec("attrib +H \"" + file.getAbsolutePath() + "\""); +// } catch (IOException e) { +// // do nothing as this is not of a higher priority +// // add log statements here when logging is done +// } +// } + } + + public static void setFileArchive(File file) throws ZipException { +// if (file == null) { +// throw new ZipException("input file is null. cannot set archive file attribute"); +// } +// +// if (!isWindows()) { +// return; +// } +// +// if (file.exists()) { +// try { +// if (file.isDirectory()) { +// Runtime.getRuntime().exec("attrib +A \"" + file.getAbsolutePath() + "\""); +// } else { +// Runtime.getRuntime().exec("attrib +A \"" + file.getAbsolutePath() + "\""); +// } +// +// } catch (IOException e) { +// // do nothing as this is not of a higher priority +// // add log statements here when logging is done +// } +// } + } + + public static void setFileSystemMode(File file) throws ZipException { +// if (file == null) { +// throw new ZipException("input file is null. cannot set archive file attribute"); +// } +// +// if (!isWindows()) { +// return; +// } +// +// if (file.exists()) { +// try { +// Runtime.getRuntime().exec("attrib +S \"" + file.getAbsolutePath() + "\""); +// } catch (IOException e) { +// // do nothing as this is not of a higher priority +// // add log statements here when logging is done +// } +// } + } + + public static long getLastModifiedFileTime(File file, TimeZone timeZone) throws ZipException { + if (file == null) { + throw new ZipException("input file is null, cannot read last modified file time"); + } + + if (!file.exists()) { + throw new ZipException("input file does not exist, cannot read last modified file time"); + } + + return file.lastModified(); + } + + public static String getFileNameFromFilePath(File file) throws ZipException { + if (file == null) { + throw new ZipException("input file is null, cannot get file name"); + } + + if (file.isDirectory()) { + return null; + } + + return file.getName(); + } + + public static long getFileLengh(String file) throws ZipException { + if (!isStringNotNullAndNotEmpty(file)) { + throw new ZipException("invalid file name"); + } + + return getFileLengh(new File(file)); + } + + public static long getFileLengh(File file) throws ZipException { + if (file == null) { + throw new ZipException("input file is null, cannot calculate file length"); + } + + if (file.isDirectory()) { + return -1; + } + + return file.length(); + } + + /** + * Converts input time from Java to DOS format + * @param time + * @return time in DOS format + */ + public static long javaToDosTime(long time) { + + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(time); + + int year = cal.get(Calendar.YEAR); + if (year < 1980) { + return (1 << 21) | (1 << 16); + } + return (year - 1980) << 25 | (cal.get(Calendar.MONTH) + 1) << 21 | + cal.get(Calendar.DATE) << 16 | cal.get(Calendar.HOUR_OF_DAY) << 11 | cal.get(Calendar.MINUTE) << 5 | + cal.get(Calendar.SECOND) >> 1; + } + + /** + * Converts time in dos format to Java format + * @param dosTime + * @return time in java format + */ + public static long dosToJavaTme(int dosTime) { + int sec = 2 * (dosTime & 0x1f); + int min = (dosTime >> 5) & 0x3f; + int hrs = (dosTime >> 11) & 0x1f; + int day = (dosTime >> 16) & 0x1f; + int mon = ((dosTime >> 21) & 0xf) - 1; + int year = ((dosTime >> 25) & 0x7f) + 1980; + + Calendar cal = Calendar.getInstance(); + cal.set(year, mon, day, hrs, min, sec); + cal.set(Calendar.MILLISECOND, 0); + return cal.getTime().getTime(); + } + + public static FileHeader getFileHeader(ZipModel zipModel, String fileName) throws ZipException { + if (zipModel == null) { + throw new ZipException("zip model is null, cannot determine file header for fileName: " + fileName); + } + + if (!isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("file name is null, cannot determine file header for fileName: " + fileName); + } + + FileHeader fileHeader = null; + fileHeader = getFileHeaderWithExactMatch(zipModel, fileName); + + if (fileHeader == null) { + fileName = fileName.replaceAll("\\\\", "/"); + fileHeader = getFileHeaderWithExactMatch(zipModel, fileName); + + if (fileHeader == null) { + fileName = fileName.replaceAll("/", "\\\\"); + fileHeader = getFileHeaderWithExactMatch(zipModel, fileName); + } + } + + return fileHeader; + } + + public static FileHeader getFileHeaderWithExactMatch(ZipModel zipModel, String fileName) throws ZipException { + if (zipModel == null) { + throw new ZipException("zip model is null, cannot determine file header with exact match for fileName: " + fileName); + } + + if (!isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("file name is null, cannot determine file header with exact match for fileName: " + fileName); + } + + if (zipModel.getCentralDirectory() == null) { + throw new ZipException("central directory is null, cannot determine file header with exact match for fileName: " + fileName); + } + + if (zipModel.getCentralDirectory().getFileHeaders() == null) { + throw new ZipException("file Headers are null, cannot determine file header with exact match for fileName: " + fileName); + } + + if (zipModel.getCentralDirectory().getFileHeaders().size() <= 0) { + return null; + } + ArrayList fileHeaders = zipModel.getCentralDirectory().getFileHeaders(); + for (int i = 0; i < fileHeaders.size(); i++) { + FileHeader fileHeader = (FileHeader)fileHeaders.get(i); + String fileNameForHdr = fileHeader.getFileName(); + if (!isStringNotNullAndNotEmpty(fileNameForHdr)) { + continue; + } + + if (fileName.equalsIgnoreCase(fileNameForHdr)) { + return fileHeader; + } + } + + return null; + } + + public static int getIndexOfFileHeader(ZipModel zipModel, + FileHeader fileHeader) throws ZipException { + + if (zipModel == null || fileHeader == null) { + throw new ZipException("input parameters is null, cannot determine index of file header"); + } + + if (zipModel.getCentralDirectory() == null) { + throw new ZipException("central directory is null, ccannot determine index of file header"); + } + + if (zipModel.getCentralDirectory().getFileHeaders() == null) { + throw new ZipException("file Headers are null, cannot determine index of file header"); + } + + if (zipModel.getCentralDirectory().getFileHeaders().size() <= 0) { + return -1; + } + String fileName = fileHeader.getFileName(); + + if (!isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("file name in file header is empty or null, cannot determine index of file header"); + } + + ArrayList fileHeaders = zipModel.getCentralDirectory().getFileHeaders(); + for (int i = 0; i < fileHeaders.size(); i++) { + FileHeader fileHeaderTmp = (FileHeader)fileHeaders.get(i); + String fileNameForHdr = fileHeaderTmp.getFileName(); + if (!isStringNotNullAndNotEmpty(fileNameForHdr)) { + continue; + } + + if (fileName.equalsIgnoreCase(fileNameForHdr)) { + return i; + } + } + return -1; + } + + public static ArrayList getFilesInDirectoryRec(File path, + boolean readHiddenFiles) throws ZipException { + + if (path == null) { + throw new ZipException("input path is null, cannot read files in the directory"); + } + + ArrayList result = new ArrayList(); + File[] filesAndDirs = path.listFiles(); + List filesDirs = Arrays.asList(filesAndDirs); + + if (!path.canRead()) { + return result; + } + + for(int i = 0; i < filesDirs.size(); i++) { + File file = (File)filesDirs.get(i); + if (file.isHidden() && !readHiddenFiles) { + return result; + } + result.add(file); + if (file.isDirectory()) { + List deeperList = getFilesInDirectoryRec(file, readHiddenFiles); + result.addAll(deeperList); + } + } + return result; + } + + public static String getZipFileNameWithoutExt(String zipFile) throws ZipException { + if (!isStringNotNullAndNotEmpty(zipFile)) { + throw new ZipException("zip file name is empty or null, cannot determine zip file name"); + } + String tmpFileName = zipFile; + if (zipFile.indexOf(System.getProperty("file.separator")) >= 0) { + tmpFileName = zipFile.substring(zipFile.lastIndexOf(System.getProperty("file.separator"))); + } + + if (tmpFileName.indexOf(".") > 0) { + tmpFileName = tmpFileName.substring(0, tmpFileName.lastIndexOf(".")); + } + return tmpFileName; + } + + public static byte[] convertCharset(String str) throws ZipException { + try { + byte[] converted = null; + String charSet = detectCharSet(str); + if (charSet.equals(InternalZipConstants.CHARSET_CP850)) { + converted = str.getBytes(InternalZipConstants.CHARSET_CP850); + } else if (charSet.equals(InternalZipConstants.CHARSET_UTF8)) { + converted = str.getBytes(InternalZipConstants.CHARSET_UTF8); + } else { + converted = str.getBytes(); + } + return converted; + } + catch (UnsupportedEncodingException err) { + return str.getBytes(); + } catch (Exception e) { + throw new ZipException(e); + } + } + + /** + * Decodes file name based on encoding. If file name is UTF 8 encoded + * returns an UTF8 encoded string, else return Cp850 encoded String. If + * appropriate charset is not supported, then returns a System default + * charset encoded String + * @param data + * @param isUTF8 + * @return String + */ + public static String decodeFileName(byte[] data, boolean isUTF8) { + if (isUTF8) { + try { + return new String(data, InternalZipConstants.CHARSET_UTF8); + } catch (UnsupportedEncodingException e) { + return new String(data); + } + } else { + return getCp850EncodedString(data); + } + } + + /** + * Returns a string in Cp850 encoding from the input bytes. + * If this encoding is not supported, then String with the default encoding is returned. + * @param data + * @return String + */ + public static String getCp850EncodedString(byte[] data) { + try { + String retString = new String(data, InternalZipConstants.CHARSET_CP850); + return retString; + } catch (UnsupportedEncodingException e) { + return new String(data); + } + } + + /** + * Returns an absoulte path for the given file path + * @param filePath + * @return String + */ + public static String getAbsoluteFilePath(String filePath) throws ZipException { + if (!isStringNotNullAndNotEmpty(filePath)) { + throw new ZipException("filePath is null or empty, cannot get absolute file path"); + } + + File file = new File(filePath); + return file.getAbsolutePath(); + } + + /** + * Checks to see if all the elements in the arraylist match the given type + * @param sourceList - list to be checked + * @param type - type of elements to be present in the list (ex: File, String, etc) + * @return true if all elements match the given type, if not returns false + */ + public static boolean checkArrayListTypes(ArrayList sourceList, int type) throws ZipException { + + if (sourceList == null) { + throw new ZipException("input arraylist is null, cannot check types"); + } + + if (sourceList.size() <= 0) { + return true; + } + + boolean invalidFound = false; + + switch (type) { + case InternalZipConstants.LIST_TYPE_FILE: + for (int i = 0; i < sourceList.size(); i++) { + if (!(sourceList.get(i) instanceof File)) { + invalidFound = true; + break; + } + } + break; + case InternalZipConstants.LIST_TYPE_STRING: + for (int i = 0; i < sourceList.size(); i++) { + if (!(sourceList.get(i) instanceof String)) { + invalidFound = true; + break; + } + } + break; + default: + break; + } + return !invalidFound; + } + + /** + * Detects the encoding charset for the input string + * @param str + * @return String - charset for the String + * @throws ZipException - if input string is null. In case of any other exception + * this method returns default System charset + */ + public static String detectCharSet(String str) throws ZipException { + if (str == null) { + throw new ZipException("input string is null, cannot detect charset"); + } + + try { + byte[] byteString = str.getBytes(InternalZipConstants.CHARSET_CP850); + String tempString = new String(byteString, InternalZipConstants.CHARSET_CP850); + + if (str.equals(tempString)) { + return InternalZipConstants.CHARSET_CP850; + } + + byteString = str.getBytes(InternalZipConstants.CHARSET_UTF8); + tempString = new String(byteString, InternalZipConstants.CHARSET_UTF8); + + if (str.equals(tempString)) { + return InternalZipConstants.CHARSET_UTF8; + } + + return InternalZipConstants.CHARSET_DEFAULT; + } catch (UnsupportedEncodingException e) { + return InternalZipConstants.CHARSET_DEFAULT; + } catch (Exception e) { + return InternalZipConstants.CHARSET_DEFAULT; + } + } + + /** + * returns the length of the string by wrapping it in a byte buffer with + * the appropriate charset of the input string and returns the limit of the + * byte buffer + * @param str + * @return length of the string + * @throws ZipException + */ + public static int getEncodedStringLength(String str) throws ZipException { + if (!isStringNotNullAndNotEmpty(str)) { + throw new ZipException("input string is null, cannot calculate encoded String length"); + } + + String charset = detectCharSet(str); + return getEncodedStringLength(str, charset); + } + + /** + * returns the length of the string in the input encoding + * @param str + * @param charset + * @return int + * @throws ZipException + */ + public static int getEncodedStringLength(String str, String charset) throws ZipException { + if (!isStringNotNullAndNotEmpty(str)) { + throw new ZipException("input string is null, cannot calculate encoded String length"); + } + + if (!isStringNotNullAndNotEmpty(charset)) { + throw new ZipException("encoding is not defined, cannot calculate string length"); + } + + ByteBuffer byteBuffer = null; + + try { + if (charset.equals(InternalZipConstants.CHARSET_CP850)) { + byteBuffer = ByteBuffer.wrap(str.getBytes(InternalZipConstants.CHARSET_CP850)); + } else if (charset.equals(InternalZipConstants.CHARSET_UTF8)) { + byteBuffer = ByteBuffer.wrap(str.getBytes(InternalZipConstants.CHARSET_UTF8)); + } else { + byteBuffer = ByteBuffer.wrap(str.getBytes(charset)); + } + } catch (UnsupportedEncodingException e) { + byteBuffer = ByteBuffer.wrap(str.getBytes()); + } catch (Exception e) { + throw new ZipException(e); + } + + return byteBuffer.limit(); + } + + /** + * Checks if the input charset is supported + * @param charset + * @return boolean + * @throws ZipException + */ + public static boolean isSupportedCharset(String charset) throws ZipException { + if (!isStringNotNullAndNotEmpty(charset)) { + throw new ZipException("charset is null or empty, cannot check if it is supported"); + } + + try { + new String("a".getBytes(), charset); + return true; + } catch (UnsupportedEncodingException e) { + return false; + } catch (Exception e) { + throw new ZipException(e); + } + } + + public static ArrayList getSplitZipFiles(ZipModel zipModel) throws ZipException { + if (zipModel == null) { + throw new ZipException("cannot get split zip files: zipmodel is null"); + } + + if (zipModel.getEndCentralDirRecord() == null) { + return null; + } + + ArrayList retList = new ArrayList(); + String currZipFile = zipModel.getZipFile(); + String zipFileName = (new File(currZipFile)).getName(); + String partFile = null; + + if (!isStringNotNullAndNotEmpty(currZipFile)) { + throw new ZipException("cannot get split zip files: zipfile is null"); + } + + if (!zipModel.isSplitArchive()) { + retList.add(currZipFile); + return retList; + } + + int numberOfThisDisk = zipModel.getEndCentralDirRecord().getNoOfThisDisk(); + + if (numberOfThisDisk == 0) { + retList.add(currZipFile); + return retList; + } else { + for (int i = 0; i <= numberOfThisDisk; i++) { + if (i == numberOfThisDisk) { + retList.add(zipModel.getZipFile()); + } else { + String fileExt = ".z0"; + if (i > 9) { + fileExt = ".z"; + } + partFile = (zipFileName.indexOf(".") >= 0) ? currZipFile.substring(0, currZipFile.lastIndexOf(".")) : currZipFile; + partFile = partFile + fileExt + (i + 1); + retList.add(partFile); + } + } + } + return retList; + } + + public static String getRelativeFileName(String file, String rootFolderInZip, String rootFolderPath) throws ZipException { + if (!Zip4jUtil.isStringNotNullAndNotEmpty(file)) { + throw new ZipException("input file path/name is empty, cannot calculate relative file name"); + } + + String fileName = null; + + if (Zip4jUtil.isStringNotNullAndNotEmpty(rootFolderPath)) { + + File rootFolderFile = new File(rootFolderPath); + + String rootFolderFileRef = rootFolderFile.getPath(); + + if (!rootFolderFileRef.endsWith(InternalZipConstants.FILE_SEPARATOR)) { + rootFolderFileRef += InternalZipConstants.FILE_SEPARATOR; + } + + String tmpFileName = file.substring(rootFolderFileRef.length()); + if (tmpFileName.startsWith(System.getProperty("file.separator"))) { + tmpFileName = tmpFileName.substring(1); + } + + File tmpFile = new File(file); + + if (tmpFile.isDirectory()) { + tmpFileName = tmpFileName.replaceAll("\\\\", "/"); + tmpFileName += InternalZipConstants.ZIP_FILE_SEPARATOR; + } else { + String bkFileName = tmpFileName.substring(0, tmpFileName.lastIndexOf(tmpFile.getName())); + bkFileName = bkFileName.replaceAll("\\\\", "/"); + tmpFileName = bkFileName + tmpFile.getName(); + } + + fileName = tmpFileName; + } else { + File relFile = new File(file); + if (relFile.isDirectory()) { + fileName = relFile.getName() + InternalZipConstants.ZIP_FILE_SEPARATOR; + } else { + fileName = Zip4jUtil.getFileNameFromFilePath(new File(file)); + } + } + + if (Zip4jUtil.isStringNotNullAndNotEmpty(rootFolderInZip)) { + fileName = rootFolderInZip + fileName; + } + + if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) { + throw new ZipException("Error determining file name"); + } + + return fileName; + } + + public static long[] getAllHeaderSignatures() { + long[] allSigs = new long[11]; + + allSigs[0] = InternalZipConstants.LOCSIG; + allSigs[1] = InternalZipConstants.EXTSIG; + allSigs[2] = InternalZipConstants.CENSIG; + allSigs[3] = InternalZipConstants.ENDSIG; + allSigs[4] = InternalZipConstants.DIGSIG; + allSigs[5] = InternalZipConstants.ARCEXTDATREC; + allSigs[6] = InternalZipConstants.SPLITSIG; + allSigs[7] = InternalZipConstants.ZIP64ENDCENDIRLOC; + allSigs[8] = InternalZipConstants.ZIP64ENDCENDIRREC; + allSigs[9] = InternalZipConstants.EXTRAFIELDZIP64LENGTH; + allSigs[10] = InternalZipConstants.AESSIG; + + return allSigs; + } +} diff --git a/lib/zip4j/src/net/lingala/zip4j/zip/ZipEngine.java b/lib/zip4j/src/net/lingala/zip4j/zip/ZipEngine.java new file mode 100644 index 00000000..067bd2ad --- /dev/null +++ b/lib/zip4j/src/net/lingala/zip4j/zip/ZipEngine.java @@ -0,0 +1,485 @@ +/* +* Copyright 2010 Srikanth Reddy Lingala +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package net.lingala.zip4j.zip; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.util.ArrayList; +import java.util.HashMap; + +import net.lingala.zip4j.exception.ZipException; +import net.lingala.zip4j.io.SplitOutputStream; +import net.lingala.zip4j.io.ZipOutputStream; +import net.lingala.zip4j.model.EndCentralDirRecord; +import net.lingala.zip4j.model.FileHeader; +import net.lingala.zip4j.model.ZipModel; +import net.lingala.zip4j.model.ZipParameters; +import net.lingala.zip4j.progress.ProgressMonitor; +import net.lingala.zip4j.util.ArchiveMaintainer; +import net.lingala.zip4j.util.CRCUtil; +import net.lingala.zip4j.util.InternalZipConstants; +import net.lingala.zip4j.util.Zip4jConstants; +import net.lingala.zip4j.util.Zip4jUtil; + +public class ZipEngine { + + private ZipModel zipModel; + + public ZipEngine(ZipModel zipModel) throws ZipException { + + if (zipModel == null) { + throw new ZipException("zip model is null in ZipEngine constructor"); + } + + this.zipModel = zipModel; + } + + public void addFiles(final ArrayList fileList, final ZipParameters parameters, + final ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + + if (fileList == null || parameters == null) { + throw new ZipException("one of the input parameters is null when adding files"); + } + + if(fileList.size() <= 0) { + throw new ZipException("no files to add"); + } + + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_ADD); + progressMonitor.setState(ProgressMonitor.STATE_BUSY); + progressMonitor.setResult(ProgressMonitor.RESULT_WORKING); + + if (runInThread) { + progressMonitor.setTotalWork(calculateTotalWork(fileList, parameters)); + progressMonitor.setFileName(((File)fileList.get(0)).getAbsolutePath()); + + Thread thread = new Thread(InternalZipConstants.THREAD_NAME) { + public void run() { + try { + initAddFiles(fileList, parameters, progressMonitor); + } catch (ZipException e) { + } + } + }; + thread.start(); + + } else { + initAddFiles(fileList, parameters, progressMonitor); + } + } + + private void initAddFiles(ArrayList fileList, ZipParameters parameters, + ProgressMonitor progressMonitor) throws ZipException { + + if (fileList == null || parameters == null) { + throw new ZipException("one of the input parameters is null when adding files"); + } + + if(fileList.size() <= 0) { + throw new ZipException("no files to add"); + } + + if (zipModel.getEndCentralDirRecord() == null) { + zipModel.setEndCentralDirRecord(createEndOfCentralDirectoryRecord()); + } + + ZipOutputStream outputStream = null; + InputStream inputStream = null; + try { + checkParameters(parameters); + + removeFilesIfExists(fileList, parameters, progressMonitor); + + boolean isZipFileAlreadExists = Zip4jUtil.checkFileExists(zipModel.getZipFile()); + + SplitOutputStream splitOutputStream = new SplitOutputStream(new File(zipModel.getZipFile()), zipModel.getSplitLength()); + outputStream = new ZipOutputStream(splitOutputStream, this.zipModel); + + if (isZipFileAlreadExists) { + if (zipModel.getEndCentralDirRecord() == null) { + throw new ZipException("invalid end of central directory record"); + } + splitOutputStream.seek(zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir()); + } + byte[] readBuff = new byte[InternalZipConstants.BUFF_SIZE]; + int readLen = -1; + for (int i = 0; i < fileList.size(); i++) { + + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + + ZipParameters fileParameters = (ZipParameters) parameters.clone(); + + progressMonitor.setFileName(((File)fileList.get(i)).getAbsolutePath()); + + if (!((File)fileList.get(i)).isDirectory()) { + if (fileParameters.isEncryptFiles() && fileParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_CALC_CRC); + fileParameters.setSourceFileCRC((int)CRCUtil.computeFileCRC(((File)fileList.get(i)).getAbsolutePath(), progressMonitor)); + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_ADD); + + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + } + + if (Zip4jUtil.getFileLengh((File)fileList.get(i)) == 0) { + fileParameters.setCompressionMethod(Zip4jConstants.COMP_STORE); + } + } + + outputStream.putNextEntry((File)fileList.get(i), fileParameters); + if (((File)fileList.get(i)).isDirectory()) { + outputStream.closeEntry(); + continue; + } + + inputStream = new FileInputStream((File)fileList.get(i)); + + while ((readLen = inputStream.read(readBuff)) != -1) { + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + + outputStream.write(readBuff, 0, readLen); + progressMonitor.updateWorkCompleted(readLen); + } + + outputStream.closeEntry(); + + if (inputStream != null) { + inputStream.close(); + } + } + + outputStream.finish(); + progressMonitor.endProgressMonitorSuccess(); + } catch (ZipException e) { + progressMonitor.endProgressMonitorError(e); + throw e; + } catch (Exception e) { + progressMonitor.endProgressMonitorError(e); + throw new ZipException(e); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + } + } + + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + } + } + } + } + + public void addStreamToZip(InputStream inputStream, ZipParameters parameters) throws ZipException { + if (inputStream == null || parameters == null) { + throw new ZipException("one of the input parameters is null, cannot add stream to zip"); + } + + ZipOutputStream outputStream = null; + + try { + checkParameters(parameters); + + boolean isZipFileAlreadExists = Zip4jUtil.checkFileExists(zipModel.getZipFile()); + + SplitOutputStream splitOutputStream = new SplitOutputStream(new File(zipModel.getZipFile()), zipModel.getSplitLength()); + outputStream = new ZipOutputStream(splitOutputStream, this.zipModel); + + if (isZipFileAlreadExists) { + if (zipModel.getEndCentralDirRecord() == null) { + throw new ZipException("invalid end of central directory record"); + } + splitOutputStream.seek(zipModel.getEndCentralDirRecord().getOffsetOfStartOfCentralDir()); + } + + byte[] readBuff = new byte[InternalZipConstants.BUFF_SIZE]; + int readLen = -1; + + outputStream.putNextEntry(null, parameters); + + if (!parameters.getFileNameInZip().endsWith("/") && + !parameters.getFileNameInZip().endsWith("\\")) { + while ((readLen = inputStream.read(readBuff)) != -1) { + outputStream.write(readBuff, 0, readLen); + } + } + + outputStream.closeEntry(); + outputStream.finish(); + + } catch (ZipException e) { + throw e; + } catch (Exception e) { + throw new ZipException(e); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + //ignore + } + } + } + } + + public void addFolderToZip(File file, ZipParameters parameters, + ProgressMonitor progressMonitor, boolean runInThread) throws ZipException { + if (file == null || parameters == null) { + throw new ZipException("one of the input parameters is null, cannot add folder to zip"); + } + + if (!Zip4jUtil.checkFileExists(file.getAbsolutePath())) { + throw new ZipException("input folder does not exist"); + } + + if (!file.isDirectory()) { + throw new ZipException("input file is not a folder, user addFileToZip method to add files"); + } + + if (!Zip4jUtil.checkFileReadAccess(file.getAbsolutePath())) { + throw new ZipException("cannot read folder: " + file.getAbsolutePath()); + } + + String rootFolderPath = null; + if (parameters.isIncludeRootFolder()) { + if (file.getAbsolutePath() != null) { + rootFolderPath = file.getAbsoluteFile().getParentFile() != null ? file.getAbsoluteFile().getParentFile().getAbsolutePath() : ""; + } else { + rootFolderPath = file.getParentFile() != null ? file.getParentFile().getAbsolutePath() : ""; + } + } else { + rootFolderPath = file.getAbsolutePath(); + } + + parameters.setDefaultFolderPath(rootFolderPath); + + ArrayList fileList = Zip4jUtil.getFilesInDirectoryRec(file, parameters.isReadHiddenFiles()); + + if (parameters.isIncludeRootFolder()) { + if (fileList == null) { + fileList = new ArrayList(); + } + fileList.add(file); + } + + addFiles(fileList, parameters, progressMonitor, runInThread); + } + + + private void checkParameters(ZipParameters parameters) throws ZipException { + + if (parameters == null) { + throw new ZipException("cannot validate zip parameters"); + } + + if ((parameters.getCompressionMethod() != Zip4jConstants.COMP_STORE) && + parameters.getCompressionMethod() != Zip4jConstants.COMP_DEFLATE) { + throw new ZipException("unsupported compression type"); + } + + if (parameters.getCompressionMethod() == Zip4jConstants.COMP_DEFLATE) { + if (parameters.getCompressionLevel() < 0 && parameters.getCompressionLevel() > 9) { + throw new ZipException("invalid compression level. compression level dor deflate should be in the range of 0-9"); + } + } + + if (parameters.isEncryptFiles()) { + if (parameters.getEncryptionMethod() != Zip4jConstants.ENC_METHOD_STANDARD && + parameters.getEncryptionMethod() != Zip4jConstants.ENC_METHOD_AES) { + throw new ZipException("unsupported encryption method"); + } + + if (parameters.getPassword() == null || parameters.getPassword().length <= 0) { + throw new ZipException("input password is empty or null"); + } + } else { + parameters.setAesKeyStrength(-1); + parameters.setEncryptionMethod(-1); + } + + } + + /** + * Before adding a file to a zip file, we check if a file already exists in the zip file + * with the same fileName (including path, if exists). If yes, then we remove this file + * before adding the file

+ * + * Note: Relative path has to be passed as the fileName + * + * @param zipModel + * @param fileName + * @throws ZipException + */ + private void removeFilesIfExists(ArrayList fileList, ZipParameters parameters, ProgressMonitor progressMonitor) throws ZipException { + + if (zipModel == null || zipModel.getCentralDirectory() == null || + zipModel.getCentralDirectory().getFileHeaders() == null || + zipModel.getCentralDirectory().getFileHeaders().size() <= 0) { + //For a new zip file, this condition satisfies, so do nothing + return; + } + RandomAccessFile outputStream = null; + + try { + for (int i = 0; i < fileList.size(); i++) { + File file = (File) fileList.get(i); + + String fileName = Zip4jUtil.getRelativeFileName(file.getAbsolutePath(), + parameters.getRootFolderInZip(), parameters.getDefaultFolderPath()); + + FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName); + if (fileHeader != null) { + + if (outputStream != null) { + outputStream.close(); + outputStream = null; + } + + ArchiveMaintainer archiveMaintainer = new ArchiveMaintainer(); + progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_REMOVE); + HashMap retMap = archiveMaintainer.initRemoveZipFile(zipModel, + fileHeader, progressMonitor); + + if (progressMonitor.isCancelAllTasks()) { + progressMonitor.setResult(ProgressMonitor.RESULT_CANCELLED); + progressMonitor.setState(ProgressMonitor.STATE_READY); + return; + } + + progressMonitor + .setCurrentOperation(ProgressMonitor.OPERATION_ADD); + + if (outputStream == null) { + outputStream = prepareFileOutputStream(); + + if (retMap != null) { + if (retMap.get(InternalZipConstants.OFFSET_CENTRAL_DIR) != null) { + long offsetCentralDir = -1; + try { + offsetCentralDir = Long + .parseLong((String) retMap + .get(InternalZipConstants.OFFSET_CENTRAL_DIR)); + } catch (NumberFormatException e) { + throw new ZipException( + "NumberFormatException while parsing offset central directory. " + + "Cannot update already existing file header"); + } catch (Exception e) { + throw new ZipException( + "Error while parsing offset central directory. " + + "Cannot update already existing file header"); + } + + if (offsetCentralDir >= 0) { + outputStream.seek(offsetCentralDir); + } + } + } + } + } + } + } catch (IOException e) { + throw new ZipException(e); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + //ignore + } + } + } + } + + private RandomAccessFile prepareFileOutputStream() throws ZipException { + String outPath = zipModel.getZipFile(); + if (!Zip4jUtil.isStringNotNullAndNotEmpty(outPath)) { + throw new ZipException("invalid output path"); + } + + try { + File outFile = new File(outPath); + if (!outFile.getParentFile().exists()) { + outFile.getParentFile().mkdirs(); + } + return new RandomAccessFile(outFile, InternalZipConstants.WRITE_MODE); + } catch (FileNotFoundException e) { + throw new ZipException(e); + } + } + + private EndCentralDirRecord createEndOfCentralDirectoryRecord() { + EndCentralDirRecord endCentralDirRecord = new EndCentralDirRecord(); + endCentralDirRecord.setSignature(InternalZipConstants.ENDSIG); + endCentralDirRecord.setNoOfThisDisk(0); + endCentralDirRecord.setTotNoOfEntriesInCentralDir(0); + endCentralDirRecord.setTotNoOfEntriesInCentralDirOnThisDisk(0); + endCentralDirRecord.setOffsetOfStartOfCentralDir(0); + return endCentralDirRecord; + } + + private long calculateTotalWork(ArrayList fileList, ZipParameters parameters) throws ZipException { + if (fileList == null) { + throw new ZipException("file list is null, cannot calculate total work"); + } + + long totalWork = 0; + + for (int i = 0; i < fileList.size(); i++) { + if(fileList.get(i) instanceof File) { + if (((File)fileList.get(i)).exists()) { + if (parameters.isEncryptFiles() && + parameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) { + totalWork += (Zip4jUtil.getFileLengh((File)fileList.get(i)) * 2); + } else { + totalWork += Zip4jUtil.getFileLengh((File)fileList.get(i)); + } + + if (zipModel.getCentralDirectory() != null && + zipModel.getCentralDirectory().getFileHeaders() != null && + zipModel.getCentralDirectory().getFileHeaders().size() > 0) { + String relativeFileName = Zip4jUtil.getRelativeFileName( + ((File)fileList.get(i)).getAbsolutePath(), parameters.getRootFolderInZip(), parameters.getDefaultFolderPath()); + FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, relativeFileName); + if (fileHeader != null) { + totalWork += (Zip4jUtil.getFileLengh(new File(zipModel.getZipFile())) - fileHeader.getCompressedSize()); + } + } + } + } + } + + return totalWork; + } +} diff --git a/src/itdelatrisu/opsu/OszUnpacker.java b/src/itdelatrisu/opsu/OszUnpacker.java new file mode 100644 index 00000000..5acb5084 --- /dev/null +++ b/src/itdelatrisu/opsu/OszUnpacker.java @@ -0,0 +1,110 @@ +/* + * opsu! - an open-source osu! client + * Copyright (C) 2014 Jeffrey Han + * + * opsu! is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * opsu! is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with opsu!. If not, see . + */ + +package itdelatrisu.opsu; + +import java.io.File; +import java.io.FilenameFilter; + +import net.lingala.zip4j.core.ZipFile; +import net.lingala.zip4j.exception.ZipException; + +/** + * Unpacker for OSZ (ZIP) archives. + */ +public class OszUnpacker { + /** + * The index of the current file being unpacked. + */ + private static int fileIndex = -1; + + /** + * The total number of directories to parse. + */ + private static File[] files; + + // This class should not be instantiated. + private OszUnpacker() {} + + /** + * Invokes the unpacker for each OSZ archive in a root directory. + * @param root the root directory + * @param dest the destination directory + */ + public static void unpackAllFiles(File root, File dest) { + files = root.listFiles(new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.toLowerCase().endsWith(".osz"); + } + }); + if (files.length < 1) { + files = null; + return; + } + + for (File file : files) { + fileIndex++; + String dirName = file.getName().substring(0, file.getName().lastIndexOf('.')); + File songDir = new File(dest, dirName); + if (!songDir.isDirectory()) { + songDir.mkdir(); + unzip(file, songDir); + } + file.delete(); // delete the OSZ when finished + } + + fileIndex = -1; + files = null; + } + + /** + * Extracts the contents of a ZIP archive to a destination. + * @param file the ZIP archive + * @param dest the destination directory + */ + private static void unzip(File file, File dest) { + try { + ZipFile zipFile = new ZipFile(file); + zipFile.extractAll(dest.getAbsolutePath()); + } catch (ZipException e) { + e.printStackTrace(); + } + } + + /** + * Returns the name of the current file being unpacked, or null if none. + */ + public static String getCurrentFileName() { + if (files == null || fileIndex == -1) + return null; + + return files[fileIndex].getName(); + } + + /** + * Returns the progress of file unpacking, or -1 if not unpacking. + * @return the completion percent [0, 100] or -1 + */ + public static int getUnpackerProgress() { + if (files == null || fileIndex == -1) + return -1; + + return (fileIndex + 1) * 100 / files.length; + } +} \ No newline at end of file diff --git a/src/itdelatrisu/opsu/states/Options.java b/src/itdelatrisu/opsu/states/Options.java index e412ed42..f184dc27 100644 --- a/src/itdelatrisu/opsu/states/Options.java +++ b/src/itdelatrisu/opsu/states/Options.java @@ -79,10 +79,15 @@ public class Options extends BasicGameState { }; /** - * The current beatmap directory. + * The beatmap directory. */ private static File beatmapDir; + /** + * The OSZ archive directory. + */ + private static File oszDir; + /** * The current skin directory (for user skins). */ @@ -1071,7 +1076,7 @@ public class Options extends BasicGameState { public static boolean isLoadVerbose() { return loadVerbose; } /** - * Returns the current beatmap directory. + * Returns the beatmap directory. * If invalid, this will attempt to search for the directory, * and if nothing found, will create one. * @return the beatmap directory @@ -1090,6 +1095,19 @@ public class Options extends BasicGameState { return beatmapDir; } + /** + * Returns the OSZ archive directory. + * If invalid, this will return the root directory. + * @return the OSZ archive directory + */ + public static File getOSZDir() { + if (oszDir != null && oszDir.isDirectory()) + return oszDir; + + oszDir = new File("").getAbsoluteFile(); + return oszDir; + } + /** * Returns the current skin directory. * If invalid, this will create a "Skins" folder in the root directory. @@ -1131,6 +1149,9 @@ public class Options extends BasicGameState { case "BeatmapDirectory": beatmapDir = new File(value); break; + case "OSZDirectory": + oszDir = new File(value); + break; case "Skin": skinDir = new File(value); break; @@ -1250,6 +1271,8 @@ public class Options extends BasicGameState { // options writer.write(String.format("BeatmapDirectory = %s", getBeatmapDir().getAbsolutePath())); writer.newLine(); + writer.write(String.format("OSZDirectory = %s", getOSZDir().getAbsolutePath())); + writer.newLine(); writer.write(String.format("Skin = %s", getSkinDir().getAbsolutePath())); writer.newLine(); writer.write(String.format("Port = %d", port)); diff --git a/src/itdelatrisu/opsu/states/Splash.java b/src/itdelatrisu/opsu/states/Splash.java index 08a3c1e5..524ce444 100644 --- a/src/itdelatrisu/opsu/states/Splash.java +++ b/src/itdelatrisu/opsu/states/Splash.java @@ -21,9 +21,12 @@ package itdelatrisu.opsu.states; import itdelatrisu.opsu.Opsu; import itdelatrisu.opsu.OsuGroupList; import itdelatrisu.opsu.OsuParser; +import itdelatrisu.opsu.OszUnpacker; import itdelatrisu.opsu.SoundController; import itdelatrisu.opsu.Utils; +import java.io.File; + import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; @@ -32,6 +35,11 @@ import org.newdawn.slick.SlickException; import org.newdawn.slick.state.BasicGameState; import org.newdawn.slick.state.StateBasedGame; +/** + * "Splash Screen" state. + *

+ * Loads game resources and enters "Main Menu" state. + */ public class Splash extends BasicGameState { /** * Logo image. @@ -45,6 +53,7 @@ public class Splash extends BasicGameState { // game-related variables private int state; + private boolean init = false; public Splash(int state) { this.state = state; @@ -53,34 +62,12 @@ public class Splash extends BasicGameState { @Override public void init(GameContainer container, StateBasedGame game) throws SlickException { - final int width = container.getWidth(); - final int height = container.getHeight(); - logo = new Image("logo.png"); - logo = logo.getScaledCopy((height / 1.2f) / logo.getHeight()); + logo = logo.getScaledCopy((container.getHeight() / 1.2f) / logo.getHeight()); logo.setAlpha(0f); // load Utils class first (needed in other 'init' methods) Utils.init(container, game); - - // load other resources in a new thread - final SongMenu menu = (SongMenu) game.getState(Opsu.STATE_SONGMENU); - new Thread() { - @Override - public void run() { - // parse song directory - OsuParser.parseAllFiles(Options.getBeatmapDir(), width, height); - - // initialize song list - Opsu.groups.init(OsuGroupList.SORT_TITLE); - menu.setFocus(Opsu.groups.getRandomNode(), -1, true); - - // load sounds - SoundController.init(); - - finished = true; - } - }.start(); } @Override @@ -93,23 +80,63 @@ public class Splash extends BasicGameState { logo.drawCentered(width / 2, height / 2); - // progress tracking - String currentFile = OsuParser.getCurrentFileName(); - if (currentFile != null && Options.isLoadVerbose()) { + // display progress + if (Options.isLoadVerbose()) { g.setColor(Color.white); g.setFont(Utils.FONT_MEDIUM); int lineHeight = Utils.FONT_MEDIUM.getLineHeight(); - g.drawString( - String.format("Loading... (%s%%)", OsuParser.getParserProgress()), - 25, height - 25 - (lineHeight * 2) - ); - g.drawString(currentFile, 25, height - 25 - lineHeight); + + String unpackedFile = OszUnpacker.getCurrentFileName(); + String parsedFile = OsuParser.getCurrentFileName(); + if (unpackedFile != null) { + g.drawString( + String.format("Unpacking... (%d%%)", OszUnpacker.getUnpackerProgress()), + 25, height - 25 - (lineHeight * 2) + ); + g.drawString(unpackedFile, 25, height - 25 - lineHeight); + } else if (parsedFile != null) { + g.drawString( + String.format("Loading... (%d%%)", OsuParser.getParserProgress()), + 25, height - 25 - (lineHeight * 2) + ); + g.drawString(parsedFile, 25, height - 25 - lineHeight); + } } } @Override public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException { + if (!init) { + init = true; + + // load other resources in a new thread + final int width = container.getWidth(); + final int height = container.getHeight(); + final SongMenu menu = (SongMenu) game.getState(Opsu.STATE_SONGMENU); + new Thread() { + @Override + public void run() { + File beatmapDir = Options.getBeatmapDir(); + + // unpack all OSZ archives + OszUnpacker.unpackAllFiles(Options.getOSZDir(), beatmapDir); + + // parse song directory + OsuParser.parseAllFiles(beatmapDir, width, height); + + // initialize song list + Opsu.groups.init(OsuGroupList.SORT_TITLE); + menu.setFocus(Opsu.groups.getRandomNode(), -1, true); + + // load sounds + SoundController.init(); + + finished = true; + } + }.start(); + } + // fade in logo float alpha = logo.getAlpha(); if (alpha < 1f)