public class TarLeveledStructureProvider extends java.lang.Object implements ILeveledImportStructureProvider
Constructor and Description |
---|
TarLeveledStructureProvider(TarFile sourceFile)
Creates a
TarFileStructureProvider , which will operate on
the passed tar file. |
Modifier and Type | Method and Description |
---|---|
boolean |
closeArchive()
Close the archive file that was used to create this leveled structure provider.
|
protected TarEntry |
createContainer(IPath pathname)
Creates a new container tar entry with the specified name, iff it has
not already been created.
|
protected void |
createFile(TarEntry entry)
Creates a new tar file entry with the specified name.
|
java.util.List |
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) |
ResourceAttributes |
getResourceAttributes(java.lang.Object element)
Returns the resource attributes for this file.
|
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
|
TarFile |
getTarFile()
Returns the tar 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 TarLeveledStructureProvider(TarFile sourceFile)
TarFileStructureProvider
, which will operate on
the passed tar file.sourceFile
- the source TarFileprotected TarEntry createContainer(IPath pathname)
pathname
- The path representing the containerprotected void createFile(TarEntry entry)
public java.util.List getChildren(java.lang.Object element)
public java.io.InputStream getContents(java.lang.Object element)
public ResourceAttributes getResourceAttributes(java.lang.Object element)
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 TarFile getTarFile()
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