Class AbstractXmlUnpackager

  • Direct Known Subclasses:
    XJdfUnpackager

    public abstract class AbstractXmlUnpackager
    extends java.lang.Object
    Unpackaging 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.String findMasterDocumentPath()
      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.String unpackageZip​(java.lang.String targetDir)
      Unpackages a ZIP Package.
      protected java.lang.String unpackageZipTemp()
      Unpackages a ZIP Package to a temporarily directory..
      protected java.lang.String unpackageZipTemp​(java.lang.String appName)
      Unpackages a ZIP Package to a temporarily directory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractXmlUnpackager

        public AbstractXmlUnpackager​(java.lang.String pathPackage)
                              throws java.io.IOException
        Custom 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.IOException
        Unpackages 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.IOException
        Unpackages 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.IOException
        Unpackages 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.IOException
        Find 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.IOException
        Extracts 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.