Package uk.ac.starlink.connect

# Interface Leaf

All Superinterfaces:
  `Node`

All Known Implementing Classes:
  `ErrorLeaf`

public interface Leaf extends Node
Represents a non-directory type file in a (possibly remote) filesystem.

Since:
  18 Feb 2005
Author:
  Mark Taylor (Starlink)

## Method Summary

Modifier and Type
Method
Description
`uk.ac.starlink.util.DataSource`
`getDataSource()`
Returns a data source (replayable input stream) containing the data content of this leaf.
`OutputStream`
`getOutputStream()`
Returns an output stream from this leaf.

### Methods inherited from interface uk.ac.starlink.connect.Node

`getName, getParent`

## Method Details

### getDataSource

uk.ac.starlink.util.DataSource getDataSource() throws IOException
Returns a data source (replayable input stream) containing the data content of this leaf.

Returns:
  data source
Throws:
  `FileNotFoundException` - if the file named by this leaf does not exist
  `IOException` - if some other error occurs

### getOutputStream

OutputStream getOutputStream() throws IOException
Returns an output stream from this leaf. Whether the file named by this leaf already exists or not, the returned stream should effectively write to a new file (deleting an existing one if necessary).

Returns:
  output stream writing to the file named by this leaf
Throws:
  `IOException` - if there's some error