Package uk.ac.starlink.datanode.nodes
Class ZipFileDataNode
java.lang.Object
uk.ac.starlink.datanode.nodes.DefaultDataNode
uk.ac.starlink.datanode.nodes.ZipArchiveDataNode
uk.ac.starlink.datanode.nodes.ZipFileDataNode
- All Implemented Interfaces:
DataNode
A DataNode representing a zip archive stored in a file.
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionZipFileDataNode
(File file) Initialises aZipFileDataNode
from aFile
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
No custom configuration is performed.protected Iterator
getChildIteratorAtLevel
(String level, DataNode parent) Returns an iterator over the DataNodes at a given level in the hierarchy of this archive.protected List
Returns a list of all theZipEntry
objects in this zip archive.Returns an object which is in some sense the parent of the one this node is based on.Methods inherited from class uk.ac.starlink.datanode.nodes.ZipArchiveDataNode
allowsChildren, getChildIterator, getEntriesAtLevel, getName, getNodeTLA, getNodeType, getPathSeparator, isMagic
Methods inherited from class uk.ac.starlink.datanode.nodes.DefaultDataNode
beep, getChildMaker, getCreator, getDataObject, getDescription, getIcon, getLabel, getPathElement, hasDataObject, makeChild, makeErrorChild, registerDataObject, setChildMaker, setCreator, setDescription, setIconID, setLabel, setName, setParentObject, toString
-
Constructor Details
-
ZipFileDataNode
Initialises aZipFileDataNode
from aFile
object.- Parameters:
file
- aFile
object representing the file from which the node is to be created- Throws:
NoSuchDataException
-
-
Method Details
-
getParentObject
Description copied from interface:DataNode
Returns an object which is in some sense the parent of the one this node is based on. The parent is not aDataNode
, it is something which may get fed to aDataNodeFactory
to createDataNode
. If no such object exists, which may well be the case,null
should be returned.- Specified by:
getParentObject
in interfaceDataNode
- Overrides:
getParentObject
in classDefaultDataNode
- Returns:
- an object which is the parent of this one, or
null
-
getEntries
Description copied from class:ZipArchiveDataNode
Returns a list of all theZipEntry
objects in this zip archive.- Specified by:
getEntries
in classZipArchiveDataNode
- Returns:
- a List of all the
ZipEntry
objects which make up this zip archive. - Throws:
IOException
-
getChildIteratorAtLevel
Description copied from class:ZipArchiveDataNode
Returns an iterator over the DataNodes at a given level in the hierarchy of this archive. The iterator creates DataNodes for each ZipEntry in this archive whose name begins with the supplied stringlevel
.- Specified by:
getChildIteratorAtLevel
in classZipArchiveDataNode
- Parameters:
level
- the required starting substring of the name of all ZipEntries to be represented in the resultparent
- the DataNode whose children the resulting nodes will be- Returns:
- an Iterator over
DataNode
objects corresponding to the ZipEntry objects specified bylevel
- Throws:
IOException
-
configureDetail
Description copied from class:DefaultDataNode
No custom configuration is performed.- Specified by:
configureDetail
in interfaceDataNode
- Overrides:
configureDetail
in classDefaultDataNode
- Parameters:
dv
- the detail viewer which this node is given an opportunity to configure
-