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