Class ArchiveFile

  • All Implemented Interfaces:
    IArchiveFile

    public class ArchiveFile
    extends java.lang.Object
    implements IArchiveFile
    change the default format to ext2.
    • Field Detail

      • systemCacheManager

        public static final org.eclipse.birt.core.archive.cache.SystemCacheManager systemCacheManager
      • archiveName

        protected java.lang.String archiveName
        the archive file name.
      • systemId

        protected java.lang.String systemId
      • zipOnClose

        protected boolean zipOnClose
      • tmpFileName

        protected java.lang.String tmpFileName
      • tmpFileFolder

        protected static java.io.File tmpFileFolder
    • Constructor Detail

      • ArchiveFile

        public ArchiveFile​(java.lang.String fileName,
                           java.lang.String mode)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • ArchiveFile

        public ArchiveFile​(java.lang.String systemId,
                           java.lang.String fileName,
                           java.lang.String mode)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • openArchiveForReading

        protected void openArchiveForReading()
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • openArchiveForAppending

        protected void openArchiveForAppending()
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getName

        public java.lang.String getName()
        get the archive name. the archive name is the file name used to create the archive instance.
        Specified by:
        getName in interface IArchiveFile
        Returns:
        archive name.
      • close

        public void close()
                   throws java.io.IOException
        close the archive. all changed data will be flushed into disk if the file is opened for write. the file will be removed if it is opend as transient. after close, the instance can't be used any more.
        Specified by:
        close in interface IArchiveFile
        Throws:
        java.io.IOException
      • getTotalUsedCache

        public static long getTotalUsedCache()
      • setTotalCacheSize

        public static void setTotalCacheSize​(long size)
      • saveAs

        public void saveAs​(java.lang.String fileName)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public void save()
                  throws java.io.IOException
        save the file. If the file is transient file, after saving, it will be converts to normal file.
        Specified by:
        save in interface IArchiveFile
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface IArchiveFile
        Throws:
        java.io.IOException
      • refresh

        public void refresh()
                     throws java.io.IOException
        Specified by:
        refresh in interface IArchiveFile
        Throws:
        java.io.IOException
      • exists

        public boolean exists​(java.lang.String name)
        Specified by:
        exists in interface IArchiveFile
      • openEntry

        public ArchiveEntry openEntry​(java.lang.String name)
                               throws java.io.IOException
        Specified by:
        openEntry in interface IArchiveFile
        Throws:
        java.io.IOException
      • listEntries

        public java.util.List<java.lang.String> listEntries​(java.lang.String namePattern)
        Specified by:
        listEntries in interface IArchiveFile
      • createEntry

        public ArchiveEntry createEntry​(java.lang.String name)
                                 throws java.io.IOException
        Specified by:
        createEntry in interface IArchiveFile
        Throws:
        java.io.IOException
      • removeEntry

        public boolean removeEntry​(java.lang.String name)
                            throws java.io.IOException
        Specified by:
        removeEntry in interface IArchiveFile
        Throws:
        java.io.IOException
      • lockEntry

        public java.lang.Object lockEntry​(java.lang.String name)
                                   throws java.io.IOException
        Specified by:
        lockEntry in interface IArchiveFile
        Throws:
        java.io.IOException
      • unlockEntry

        public void unlockEntry​(java.lang.Object locker)
                         throws java.io.IOException
        Specified by:
        unlockEntry in interface IArchiveFile
        Throws:
        java.io.IOException
      • unzip

        protected void unzip​(java.lang.String src,
                             java.lang.String tgt)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • setTempFileFolder

        public static void setTempFileFolder​(java.lang.String folderPath)
        Sets the temporary file folder to contain temporary files. This folder should be maintained by caller to clean up. If not set, default temporary file folder will be used as defined by JDK. See javadoc in File.createTempFile(String, String, File)
        Parameters:
        folderPath - folder path