Package org.cip4.lib.xjdf
Class XJmfZipPackage
java.lang.Object
org.cip4.lib.xjdf.XJmfZipPackage
This class provides functionality all about packaging.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.XJmfZipPackage(byte[] zipArchive) Custom constructor.XJmfZipPackage(XJmfMessage rootJmf) Custom constructor.XJmfZipPackage(XJmfMessage rootJmf, @NotNull Map<URI, XJdfDocument> xJdfDocuments) Custom constructor.XJmfZipPackage(XJmfMessage rootJmf, @NotNull Map<URI, XJdfDocument> xJdfDocuments, @NotNull Map<URI, byte[]> files) Custom constructor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns a file as byte array.byte[]Returns a file as byte array.getXJdfDocument(String uri) Returns an XJDF Document by uri.getXJdfDocument(URI uri) Returns an XJDF Document by uri.Returns the XJMF Root Message in the package.Returns list of all files.byte[]Packages files to a zip archive.
-
Constructor Details
-
XJmfZipPackage
public XJmfZipPackage()Default constructor. -
XJmfZipPackage
Custom constructor. Accepting a root XJMF and a map of XJDF Documents for initializing.- Parameters:
rootJmf- The root xjmf message.- Throws:
XJdfValidationExceptionXJdfParseException
-
XJmfZipPackage
public XJmfZipPackage(XJmfMessage rootJmf, @NotNull @NotNull Map<URI, XJdfDocument> xJdfDocuments) throws XJdfValidationException, XJdfParseExceptionCustom constructor. Accepting a root XJMF and a map of XJDF Documents for initializing.- Parameters:
rootJmf- The root xjmf message.xJdfDocuments- Map of XJDF Documents- Throws:
XJdfValidationExceptionXJdfParseException
-
XJmfZipPackage
public XJmfZipPackage(XJmfMessage rootJmf, @NotNull @NotNull Map<URI, XJdfDocument> xJdfDocuments, @NotNull @NotNull Map<URI, throws XJdfValidationException, XJdfParseExceptionbyte[]> files) Custom constructor. Accepting a root XJMF and a map of XJDF Documents for initializing.- Parameters:
rootJmf- The root xjmf message.xJdfDocuments- Map of XJDF Documentsfiles- Map of files- Throws:
XJdfValidationExceptionXJdfParseException
-
XJmfZipPackage
Custom constructor. Accepting a zip archive for initializing.- Throws:
IOExceptionURISyntaxException
-
-
Method Details
-
listFiles
Returns list of all files.- Returns:
- Set of file URIs.
-
getFile
Returns a file as byte array.- Parameters:
uri- The uri as string.- Returns:
- The file as byte array.
- Throws:
URISyntaxException
-
getFile
Returns a file as byte array.- Parameters:
uri- The uri object.- Returns:
- The file as byte array.
-
getXJdfDocument
public XJdfDocument getXJdfDocument(String uri) throws XJdfInitException, XJdfParseException, URISyntaxException Returns an XJDF Document by uri.- Parameters:
uri- The uri object.- Returns:
- The XJDF Document.
- Throws:
XJdfInitExceptionXJdfParseExceptionURISyntaxException
-
getXJdfDocument
Returns an XJDF Document by uri.- Parameters:
uri- The uri object.- Returns:
- The XJDF Document.
- Throws:
XJdfInitExceptionXJdfParseException
-
getXJmfRoot
Returns the XJMF Root Message in the package.- Returns:
- The XJMF root message.
- Throws:
XJdfInitExceptionXJdfParseException
-
packageFiles
Packages files to a zip archive.- Returns:
- The zip packaged files as byte array.
- Throws:
IOException
-