public class ZipLeveledStructureProvider extends java.lang.Object implements ILeveledImportStructureProvider
Constructor and Description |
---|
ZipLeveledStructureProvider(java.util.zip.ZipFile sourceFile)
Creates a
ZipFileStructureProvider , which will operate on
the passed zip file. |
Modifier and Type | Method and Description |
---|---|
boolean |
closeArchive()
Close the archive file that was used to create this leveled structure provider.
|
protected java.util.zip.ZipEntry |
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<java.util.zip.ZipEntry> |
getChildren(java.lang.Object element) |
java.io.InputStream |
getContents(java.lang.Object element) |
java.lang.String |
getFullPath(java.lang.Object element) |
java.lang.String |
getLabel(java.lang.Object element) |
java.lang.Object |
getRoot()
Returns the entry that this importer uses as the root sentinel.
|
int |
getStrip()
Returns the number of directories that this IImportStructureProvider is
stripping from the file name
|
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) |
void |
setStrip(int level)
Tells the provider to strip N number of directories from the path of any
path or file name returned by the IImportStructureProvider (Default=0).
|
public ZipLeveledStructureProvider(java.util.zip.ZipFile sourceFile)
ZipFileStructureProvider
, which will operate on
the passed zip file.sourceFile
- The source file to create the ZipLeveledStructureProvider
aroundprotected java.util.zip.ZipEntry createContainer(IPath pathname)
pathname
- The path representing the containerprotected void createFile(java.util.zip.ZipEntry entry)
public java.util.List<java.util.zip.ZipEntry> getChildren(java.lang.Object element)
public java.io.InputStream getContents(java.lang.Object element)
public java.lang.String getFullPath(java.lang.Object element)
public java.lang.String getLabel(java.lang.Object element)
public java.lang.Object getRoot()
getRoot
in interface ILeveledImportStructureProvider
public java.util.zip.ZipFile getZipFile()
public boolean closeArchive()
ILeveledImportStructureProvider
closeArchive
in interface ILeveledImportStructureProvider
true
if the archive was closed successfullyprotected void initialize()
public boolean isFolder(java.lang.Object element)
public void setStrip(int level)
ILeveledImportStructureProvider
setStrip
in interface ILeveledImportStructureProvider
level
- The number of directories to strippublic int getStrip()
ILeveledImportStructureProvider
getStrip
in interface ILeveledImportStructureProvider