Package org.cip4.lib.xjdf.xml.internal
Class AbstractXmlUnpackager
- java.lang.Object
-
- org.cip4.lib.xjdf.xml.internal.AbstractXmlUnpackager
-
- Direct Known Subclasses:
XJdfUnpackager
public abstract class AbstractXmlUnpackager extends java.lang.ObjectUnpackaging logic for packages.
-
-
Constructor Summary
Constructors Constructor Description AbstractXmlUnpackager(java.lang.String pathPackage)Custom constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]extractFile(java.lang.String relativePath)Extracts a file from Package.protected byte[]findMasterDocument()Find the master document in package file.protected java.lang.StringfindMasterDocumentPath()Find the master document path in package file.protected abstract java.lang.String[]getMasterExtension()Defines the file extension of the master file.protected java.lang.StringunpackageZip(java.lang.String targetDir)Unpackages a ZIP Package.protected java.lang.StringunpackageZipTemp()Unpackages a ZIP Package to a temporarily directory..protected java.lang.StringunpackageZipTemp(java.lang.String appName)Unpackages a ZIP Package to a temporarily directory.
-
-
-
Constructor Detail
-
AbstractXmlUnpackager
public AbstractXmlUnpackager(java.lang.String pathPackage) throws java.io.IOExceptionCustom constructor. Accepting a package path for initializing.- Parameters:
pathPackage- Path of the package.- Throws:
java.io.IOException- Is thrown in case an IOExcetion occurs.
-
-
Method Detail
-
unpackageZipTemp
protected java.lang.String unpackageZipTemp() throws java.io.IOExceptionUnpackages a ZIP Package to a temporarily directory..- Returns:
- Path to master file.
- Throws:
java.io.IOException
-
unpackageZipTemp
protected java.lang.String unpackageZipTemp(java.lang.String appName) throws java.io.IOExceptionUnpackages a ZIP Package to a temporarily directory.- Parameters:
appName- Application name.- Returns:
- Path to master file.
- Throws:
java.io.IOException
-
unpackageZip
protected java.lang.String unpackageZip(java.lang.String targetDir) throws java.io.IOExceptionUnpackages a ZIP Package.- Parameters:
targetDir- Target destionation.- Returns:
- Path to master file.
- Throws:
java.io.IOException
-
findMasterDocumentPath
protected java.lang.String findMasterDocumentPath()
Find the master document path in package file.- Returns:
- The master document as byte array.
-
findMasterDocument
protected byte[] findMasterDocument() throws java.io.IOExceptionFind the master document in package file.- Returns:
- The master document as byte array.
- Throws:
java.io.IOException- Is thrown in case an IOExcetion occurs.
-
extractFile
public byte[] extractFile(java.lang.String relativePath) throws java.io.IOExceptionExtracts a file from Package.- Parameters:
relativePath- The relative path of the file which should be extracted.- Returns:
- File as byte array.
- Throws:
java.io.IOException
-
getMasterExtension
protected abstract java.lang.String[] getMasterExtension()
Defines the file extension of the master file.- Returns:
- Array of master file extensions.
-
-