public class ZipFileStructureProvider extends java.lang.Object implements IImportStructureProvider
| Constructor and Description |
|---|
ZipFileStructureProvider(java.util.zip.ZipFile sourceFile)
Creates a
ZipFileStructureProvider, which will operate
on the passed zip file. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToChildren(java.util.zip.ZipEntry parent,
java.util.zip.ZipEntry child)
Adds the specified child to the internal collection of the parent's children.
|
protected void |
createContainer(IPath pathname)
Creates a new container zip entry with the specified name, iff
it has not already been created.
|
protected void |
createFile(java.util.zip.ZipEntry entry)
Creates a new file zip entry with the specified name.
|
java.util.List<?> |
getChildren(java.lang.Object element)
Returns a collection with the children of the specified structured element.
|
java.io.InputStream |
getContents(java.lang.Object element)
Returns the contents of the specified structured element, or
null if there is a problem determining the element's
contents. |
java.lang.String |
getFullPath(java.lang.Object element)
Returns the full path of the specified structured element.
|
java.lang.String |
getLabel(java.lang.Object element)
Returns the display label of the specified structured element.
|
java.util.zip.ZipEntry |
getRoot()
Returns the entry that this importer uses as the root sentinel.
|
java.util.zip.ZipFile |
getZipFile()
Returns the zip file that this provider provides structure for.
|
protected void |
initialize()
Initializes this object's children table based on the contents of
the specified source file.
|
boolean |
isFolder(java.lang.Object element)
Returns a boolean indicating whether the passed structured element represents
a container element (as opposed to a leaf element).
|
public ZipFileStructureProvider(java.util.zip.ZipFile sourceFile)
ZipFileStructureProvider, which will operate
on the passed zip file.sourceFile - the zip file used to create this structure providerprotected void addToChildren(java.util.zip.ZipEntry parent,
java.util.zip.ZipEntry child)
protected void createContainer(IPath pathname)
protected void createFile(java.util.zip.ZipEntry entry)
public java.util.List<?> getChildren(java.lang.Object element)
IImportStructureProvidergetChildren in interface IImportStructureProviderelement - the element for which to compute the childrenpublic java.io.InputStream getContents(java.lang.Object element)
IImportStructureProvidernull if there is a problem determining the element's
contents.
Note:: The client is responsible for closing the stream when finished.
getContents in interface IImportStructureProviderelement - a structured elementnullpublic java.lang.String getFullPath(java.lang.Object element)
IImportStructureProvidergetFullPath in interface IImportStructureProviderelement - a structured elementpublic java.lang.String getLabel(java.lang.Object element)
IImportStructureProvidergetLabel in interface IImportStructureProviderelement - a structured elementpublic java.util.zip.ZipEntry getRoot()
public java.util.zip.ZipFile getZipFile()
protected void initialize()
public boolean isFolder(java.lang.Object element)
IImportStructureProviderisFolder in interface IImportStructureProviderelement - java.lang.Object
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.