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).
|
File |
getFile()
Returns the archive's ZIP-file.
|
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
PackageArchive
PackageArchive
's ZIP-file with the given ZipFileProcessor
.processZipFile
in interface PackageArchive
T
- the return type of the ZipFileProcessor
processor
- a ZipFileProcessor
<T>
IOException
- ZipFileProcessor.process(org.apache.commons.compress.archivers.zip.ZipFile)
throws an IOException
public boolean isValid()
PackageArchive
PackageArchive
, meaning it's ZIP-file has a valid structure and contains a
valid "application.xml".isValid
in interface PackageArchive
true
if this a valid PackageArchive
, false
otherwisepublic PackageInfo getPackageInfo()
PackageArchive
PackageInfo
unmarshalled from the archive's
"application.xml". This methods returns null
, if
PackageArchive.isValid()
returns false
.getPackageInfo
in interface PackageArchive
PackageInfo
public String getFilePrefix()
public byte[] getBytes() throws IOException
PackageArchive
PackageArchive.isValid()
returns
true
.getBytes
in interface PackageArchive
IOException
- if the ZIP-file could not be readpublic File getFile()
PackageArchive
getFile
in interface PackageArchive
public static String getFileName(String applicationName, String applicationVersion, String applicationTimestamp)
public PackageType getType()
PackageArchive
PackageType
for this PackageArchive
.getType
in interface PackageArchive
PackageType
public String getChecksum()
PackageArchive
getChecksum
in interface PackageArchive
Copyright © 2011–2023 aiticon GmbH. All rights reserved.