# 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`

public class ZipFileDataNode extends ZipArchiveDataNode
A DataNode representing a zip archive stored in a file.

Author:
  Mark Taylor (Starlink)

## Constructor Summary

Constructors
Constructor
Description
`ZipFileDataNode(File file)`
Initialises a `ZipFileDataNode` from a `File` object.

## Method Summary

Modifier and Type
Method
Description
`void`
`configureDetail(DetailViewer dv)`
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`
`getEntries()`
Returns a list of all the `ZipEntry` objects in this zip archive.
`Object`
`getParentObject()`
Returns an object which is in some sense the parent of the one this node is based on.

### Methods inherited from class ZipArchiveDataNode

`allowsChildren, getChildIterator, getEntriesAtLevel, getName, getNodeTLA, getNodeType, getPathSeparator, isMagic`

### Methods inherited from class DefaultDataNode

`beep, getChildMaker, getCreator, getDataObject, getDescription, getIcon, getLabel, getPathElement, hasDataObject, makeChild, makeErrorChild, registerDataObject, setChildMaker, setCreator, setDescription, setIconID, setLabel, setName, setParentObject, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ZipFileDataNode

public ZipFileDataNode(File file) throws NoSuchDataException
Initialises a `ZipFileDataNode` from a `File` object.

Parameters:
  `file` - a `File` object representing the file from which the node is to be created
Throws:
  `NoSuchDataException`

## Method Details

### getParentObject

public Object 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 a `DataNode`, it is something which may get fed to a `DataNodeFactory` to create `DataNode`. If no such object exists, which may well be the case, `null` should be returned.

Specified by:
  `getParentObject` in interface `DataNode`
Overrides:
  `getParentObject` in class `DefaultDataNode`
Returns:
  an object which is the parent of this one, or `null`

### getEntries

protected List getEntries() throws IOException
Description copied from class: `ZipArchiveDataNode`
Returns a list of all the `ZipEntry` objects in this zip archive.

Specified by:
  `getEntries` in class `ZipArchiveDataNode`
Returns:
  a List of all the `ZipEntry` objects which make up this zip archive.
Throws:
  `IOException`

### getChildIteratorAtLevel

protected Iterator getChildIteratorAtLevel(String level, DataNode parent) throws IOException
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 string `level`.

Specified by:
  `getChildIteratorAtLevel` in class `ZipArchiveDataNode`
Parameters:
  `level` - the required starting substring of the name of all ZipEntries to be represented in the result
  `parent` - the DataNode whose children the resulting nodes will be
Returns:
  an Iterator over `DataNode` objects corresponding to the ZipEntry objects specified by `level`
Throws:
  `IOException`

### configureDetail

public void configureDetail(DetailViewer dv)
Description copied from class: `DefaultDataNode`
No custom configuration is performed.

Specified by:
  `configureDetail` in interface `DataNode`
Overrides:
  `configureDetail` in class `DefaultDataNode`
Parameters:
  `dv` - the detail viewer which this node is given an opportunity to configure