Package org.appng.core.model
Interface PackageArchive
-
- All Known Implementing Classes:
PackageArchiveImpl
public interface PackageArchive
An ApplicationArchive contains informations about aApplication
in aRepository
. Those informations are obtained from theApplication
's ZIP-file.- Author:
- Matthias Herlitzius
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.PackageInfo
getPackageInfo()
Returns aPackageInfo
unmarshalled from the archive's "application.xml".PackageType
getType()
Returns thePackageType
for thisPackageArchive
.boolean
isValid()
Checks whether this is a validPackageArchive
, meaning it's ZIP-file has a valid structure and contains a valid "application.xml".<T> T
processZipFile(ZipFileProcessor<T> processor)
Processes thePackageArchive
's ZIP-file with the givenZipFileProcessor
.
-
-
-
Method Detail
-
isValid
boolean isValid()
Checks whether this is a validPackageArchive
, meaning it's ZIP-file has a valid structure and contains a valid "application.xml".- Returns:
true
if this a validPackageArchive
,false
otherwise
-
getPackageInfo
PackageInfo getPackageInfo()
Returns aPackageInfo
unmarshalled from the archive's "application.xml". This methods returnsnull
, ifisValid()
returnsfalse
.- Returns:
- a
PackageInfo
-
processZipFile
<T> T processZipFile(ZipFileProcessor<T> processor) throws IOException
Processes thePackageArchive
's ZIP-file with the givenZipFileProcessor
.- Type Parameters:
T
- the return type of theZipFileProcessor
- Parameters:
processor
- aZipFileProcessor
- Returns:
- an object of type
<T>
- Throws:
IOException
-- if
ZipFileProcessor.process(org.apache.commons.compress.archivers.zip.ZipFile)
throws anIOException
- if the ZIP-file could not be read
- if
-
getFile
File getFile()
Returns the archive's ZIP-file.- Returns:
- the file
-
getBytes
byte[] getBytes() throws IOException
Returns the binary data of the archive's ZIP-file. Should only be called ifisValid()
returnstrue
.- Returns:
- the binary data
- Throws:
IOException
- if the ZIP-file could not be read
-
getType
PackageType getType()
Returns thePackageType
for thisPackageArchive
.- Returns:
- the
PackageType
-
getChecksum
String getChecksum()
Returns the checksum for this archive (SHA256).- Returns:
- the checksum
-
-