public class PackageArchiveImpl extends Object implements PackageArchive
| Constructor and Description |
|---|
PackageArchiveImpl(File archive,
boolean strict) |
PackageArchiveImpl(File archive,
String originalFilename) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Returns the binary data of the archive's ZIP-file.
|
String |
getChecksum()
Returns the checksum for this archive (SHA256).
|
static String |
getFileName(String applicationName,
String applicationVersion,
String applicationTimestamp) |
String |
getFilePrefix() |
static String |
getFilePrefix(String applicationName,
String applicationVersion) |
PackageInfo |
getPackageInfo()
Returns a
PackageInfo unmarshalled from the archive's
"application.xml". |
PackageType |
getType()
Returns the
PackageType for this PackageArchive. |
boolean |
isValid()
Checks whether this is a valid
PackageArchive, meaning it's ZIP-file has a valid structure and contains a
valid "application.xml". |
<T> T |
processZipFile(ZipFileProcessor<T> processor)
Processes the
PackageArchive's ZIP-file with the given ZipFileProcessor. |
String |
toString() |
public PackageArchiveImpl(File archive, boolean strict)
public <T> T processZipFile(ZipFileProcessor<T> processor) throws IOException
PackageArchivePackageArchive's ZIP-file with the given ZipFileProcessor.processZipFile in interface PackageArchiveT - the return type of the ZipFileProcessorprocessor - a ZipFileProcessor<T>IOException - ZipFileProcessor.process(org.apache.commons.compress.archivers.zip.ZipFile) throws an
IOException
public boolean isValid()
PackageArchivePackageArchive, meaning it's ZIP-file has a valid structure and contains a
valid "application.xml".isValid in interface PackageArchivetrue if this a valid PackageArchive, false otherwisepublic PackageInfo getPackageInfo()
PackageArchivePackageInfo unmarshalled from the archive's
"application.xml". This methods returns null, if
PackageArchive.isValid() returns false.getPackageInfo in interface PackageArchivePackageInfopublic String getFilePrefix()
public byte[] getBytes()
throws IOException
PackageArchivePackageArchive.isValid() returns
true.getBytes in interface PackageArchiveIOException - if the ZIP-file could not be readpublic static String getFileName(String applicationName, String applicationVersion, String applicationTimestamp)
public PackageType getType()
PackageArchivePackageType for this PackageArchive.getType in interface PackageArchivePackageTypepublic String getChecksum()
PackageArchivegetChecksum in interface PackageArchiveCopyright © 2011–2018 aiticon GmbH. All rights reserved.