Package org.cip4.lib.xjdf.xml
Class XJdfPackager
Packaging logic for XJDF Documents. Package an XJDF with all references in a ZIP Package.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cip4.lib.xjdf.xml.internal.AbstractXmlPackager
AbstractXmlPackager.CompressionLevel -
Constructor Summary
ConstructorsConstructorDescriptionXJdfPackager(OutputStream out) Create a new XJdfPackager.XJdfPackager(Path zipPath, OutputStream out) Create a new XJdfPackager. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidpackageXjdf(XJDF xjdf) Packages an XML Document to a zipped binary output stream.final voidpackageXjdf(XJDF xjdf, String docName) Packages an XML Document to a zipped binary output stream.protected final byte[]parseDocument(XJDF xjdf, boolean validation) Parses an XML document into a byte array.Methods inherited from class org.cip4.lib.xjdf.xml.internal.AbstractXmlPackager
isValidation, packageXml, setCompressionLevel, setValidation, withZipPath
-
Constructor Details
-
XJdfPackager
Create a new XJdfPackager.- Parameters:
out- The underlying OutputStream to write the package to.
-
XJdfPackager
Create a new XJdfPackager. This constructor should be used if an existing archive should be enhanced.- Parameters:
zipPath- The path to an existing archive.out- The underlying OutputStream to write the package to.
-
-
Method Details
-
packageXjdf
Packages an XML Document to a zipped binary output stream.- Parameters:
xjdf- The XJDF document to package.- Throws:
PackagerException- If the XML document could not be packaged.
-
packageXjdf
Packages an XML Document to a zipped binary output stream.- Parameters:
xjdf- The XJDF to package.docName- Document's name in the zipped package.- Throws:
PackagerException- If the XML document could not be packaged.
-
parseDocument
Description copied from class:AbstractXmlPackagerParses an XML document into a byte array.- Specified by:
parseDocumentin classAbstractXmlPackager<XJDF>- Parameters:
xjdf- XML document to parse.validation- true, in case XML validation should be validated before packaging.- Returns:
- Parsed document as byte array.
- Throws:
Exception- If parsing fails.
-