Class ImpExZip

  • All Implemented Interfaces:
    ImpExFile

    public class ImpExZip
    extends java.lang.Object
    implements ImpExFile
    This class will be used as a container for exported data and medias.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImpExZip()  
      ImpExZip​(java.lang.String fileName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      closes the currently open ZipEntry and ZipOutpuStream
      void closeEntry()
      closes the currently used ZipEntry
      boolean containsEntry​(java.lang.String entryname)  
      java.lang.String getCurrentEntryName()
      returns the name of the currently 'open' ZipEntry
      java.io.File getFile()
      returns the currently used file instance (could be null)
      java.lang.String getFileExtension()
      Returns the file extension of the file associated with this instance.
      java.lang.String getMimeType()
      returns the mime type (here: MediaManager.getInstance().getMimeTypeByExtension( EXTENSION_ZIP ))
      java.io.OutputStream getOutputStream()
      returns the currently used ZipOutputStream
      boolean hasOpenEntry()
      returns true if there exists an 'open' ZipEntry
      void startNewEntry​(java.lang.String filename)
      creates a new ZipEntry with the specified name
      • Methods inherited from class java.lang.Object

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

      • ImpExZip

        public ImpExZip()
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • ImpExZip

        public ImpExZip​(java.lang.String fileName)
                 throws java.io.IOException
        Parameters:
        fileName -
        Throws:
        java.io.IOException
    • Method Detail

      • getOutputStream

        public java.io.OutputStream getOutputStream()
        returns the currently used ZipOutputStream
        Specified by:
        getOutputStream in interface ImpExFile
        Returns:
        OutputStream
      • startNewEntry

        public void startNewEntry​(java.lang.String filename)
                           throws java.io.IOException
        creates a new ZipEntry with the specified name
        Parameters:
        filename - name of the new ZipEntry
        Throws:
        java.io.IOException
      • hasOpenEntry

        public boolean hasOpenEntry()
        returns true if there exists an 'open' ZipEntry
        Returns:
        true if there exists an 'open' ZipEntry
      • getCurrentEntryName

        public java.lang.String getCurrentEntryName()
        returns the name of the currently 'open' ZipEntry
        Returns:
        ennty name
      • close

        public void close()
                   throws java.io.IOException
        closes the currently open ZipEntry and ZipOutpuStream
        Specified by:
        close in interface ImpExFile
        Throws:
        java.io.IOException
      • closeEntry

        public void closeEntry()
                        throws java.io.IOException
        closes the currently used ZipEntry
        Throws:
        java.io.IOException
      • getFile

        public java.io.File getFile()
        returns the currently used file instance (could be null)
        Specified by:
        getFile in interface ImpExFile
        Returns:
        the used file
      • getMimeType

        public java.lang.String getMimeType()
        returns the mime type (here: MediaManager.getInstance().getMimeTypeByExtension( EXTENSION_ZIP ))
        Specified by:
        getMimeType in interface ImpExFile
        Returns:
        mime typ
      • getFileExtension

        public java.lang.String getFileExtension()
        Description copied from interface: ImpExFile
        Returns the file extension of the file associated with this instance.
        Specified by:
        getFileExtension in interface ImpExFile
        Returns:
        the file extension of the file associated with this instance
      • containsEntry

        public boolean containsEntry​(java.lang.String entryname)