Class ZipDirectory

    • Constructor Detail

      • ZipDirectory

        public ZipDirectory​( zip1,
                            ZipDirectory parent,
                            ZipCloseableDirectory cache)
        Constructs a directory in the zip.
        zip1 - the zip file.
        entry1 - the entry in the zip representing this dir.
        parent - the parent directory.
      • ZipDirectory

        public ZipDirectory​( fs,
                            IDirectory parent)
        This constructor creates the root of the zip.
        file -
        fs -
        parent -
    • Method Detail

      • getFile

        public IFile getFile​(java.lang.String name)
        Description copied from interface: IDirectory
        Gets the requested file under this directory. The file may be located any number of levels within this directory. The name is relative to this directory. If the file cannot be found it will return null.
        Specified by:
        getFile in interface IDirectory
        name - the name of the file.
        the IFile, or null if no such file exists.
      • isRoot

        public boolean isRoot()
        Specified by:
        isRoot in interface IDirectory
        true if this IDirectory is the root of the virtual file system.
      • listFiles

        public java.util.List<IFile> listFiles()
        Specified by:
        listFiles in interface IDirectory
        the list of files in this directory. Files must be in this directory and not in sub-directories.
      • listAllFiles

        public java.util.List<IFile> listAllFiles()
        Specified by:
        listAllFiles in interface IDirectory
        the list of files in all directories (including sub-directories). This is the complete list.
      • iterator

        public java.util.Iterator<IFile> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<IFile>
      • convert

        public IDirectory convert()
        Specified by:
        convert in interface IFile
        convert in class ZipFileImpl
        if this is a directory return this as an IDirectory, otherwise return null.
      • isFile

        public boolean isFile()
        Specified by:
        isFile in interface IFile
        isFile in class ZipFileImpl
        true iff this IFile is not an IDirectory
      • open

        public open()
        Description copied from interface: IFile
        The input stream returned by this method should always be closed after use.
        Specified by:
        open in interface IFile
        open in class ZipFileImpl
        An InputStream to read the file from.
      • isZipRoot

        public boolean isZipRoot()
      • equals

        public boolean equals​(java.lang.Object other)
        equals in class ZipFileImpl
      • toCloseable

        public ICloseableDirectory toCloseable()
        Description copied from interface: IDirectory
        Open a more effective implementation with user regulated resource management. The implementation will be more efficient for batch operations. Make sure to call close when finished with the returned IDirectory. IFiles and IDirectories other than the returned closeable directory will stay valid after calling the close method but will no longer perform as efficiently. InputStreams that are open at the time of calling close may be invalidated.
        Specified by:
        toCloseable in interface IDirectory
        ICloseableDirectory or null if a batch aware version of this IDirectory is not supported