Class ZipFileStructureProvider

    • Constructor Detail

      • ZipFileStructureProvider

        public ZipFileStructureProvider​(ZipFile sourceFile)
        Creates a ZipFileStructureProvider, which will operate on the passed zip file.
        sourceFile - the zip file used to create this structure provider
    • Method Detail

      • addToChildren

        protected void addToChildren​(ZipEntry parent,
                                     ZipEntry child)
        Adds the specified child to the internal collection of the parent's children.
      • createContainer

        protected void createContainer​(IPath pathname)
        Creates a new container zip entry with the specified name, iff it has not already been created.
      • createFile

        protected void createFile​(ZipEntry entry)
        Creates a new file zip entry with the specified name.
      • getChildren

        public List<?> getChildren​(Object element)
        Description copied from interface: IImportStructureProvider
        Returns a collection with the children of the specified structured element.
        Specified by:
        getChildren in interface IImportStructureProvider
        element - the element for which to compute the children
        the list of child elements
      • getContents

        public InputStream getContents​(Object element)
        Description copied from interface: IImportStructureProvider
        Returns the contents of the specified structured element, or null if there is a problem determining the element's contents.

        Note:: The client is responsible for closing the stream when finished.

        Specified by:
        getContents in interface IImportStructureProvider
        element - a structured element
        the contents of the structured element, or null
      • getRoot

        public ZipEntry getRoot()
        Returns the entry that this importer uses as the root sentinel.
      • getZipFile

        public ZipFile getZipFile()
        Returns the zip file that this provider provides structure for.
        the zip file this provider provides structure for
      • initialize

        protected void initialize()
        Initializes this object's children table based on the contents of the specified source file.
      • isFolder

        public boolean isFolder​(Object element)
        Description copied from interface: IImportStructureProvider
        Returns a boolean indicating whether the passed structured element represents a container element (as opposed to a leaf element).
        Specified by:
        isFolder in interface IImportStructureProvider
        element - java.lang.Object