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

Method Summary
 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 Detail

getDataSource

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

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.