Class AbstractXmlUnpackager

java.lang.Object
org.cip4.lib.xjdf.xml.internal.AbstractXmlUnpackager
Direct Known Subclasses:
XJdfUnpackager

public abstract class AbstractXmlUnpackager extends Object
Unpackaging logic for packages.
  • Constructor Details

    • AbstractXmlUnpackager

      public AbstractXmlUnpackager(String pathPackage) throws IOException
      Custom constructor. Accepting a package path for initializing.
      Parameters:
      pathPackage - Path of the package.
      Throws:
      IOException - Is thrown in case an IOExcetion occurs.
  • Method Details

    • unpackageZipTemp

      protected String unpackageZipTemp() throws IOException
      Unpackages a ZIP Package to a temporarily directory..
      Returns:
      Path to master file.
      Throws:
      IOException
    • unpackageZipTemp

      protected String unpackageZipTemp(String appName) throws IOException
      Unpackages a ZIP Package to a temporarily directory.
      Parameters:
      appName - Application name.
      Returns:
      Path to master file.
      Throws:
      IOException
    • unpackageZip

      protected String unpackageZip(String targetDir) throws IOException
      Unpackages a ZIP Package.
      Parameters:
      targetDir - Target destionation.
      Returns:
      Path to master file.
      Throws:
      IOException
    • findMasterDocumentPath

      protected String findMasterDocumentPath()
      Find the master document path in package file.
      Returns:
      The master document as byte array.
    • findMasterDocument

      protected byte[] findMasterDocument() throws IOException
      Find the master document in package file.
      Returns:
      The master document as byte array.
      Throws:
      IOException - Is thrown in case an IOExcetion occurs.
    • extractFile

      public byte[] extractFile(String relativePath) throws IOException
      Extracts a file from Package.
      Parameters:
      relativePath - The relative path of the file which should be extracted.
      Returns:
      File as byte array.
      Throws:
      IOException
    • getMasterExtension

      protected abstract String[] getMasterExtension()
      Defines the file extension of the master file.
      Returns:
      Array of master file extensions.