Package uk.ac.starlink.connect
Class ErrorLeaf
- java.lang.Object
-
- uk.ac.starlink.connect.ErrorLeaf
-
-
Method Summary
All Methods Instance Methods Concrete Methods 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.java.lang.String
getName()
Returns the name of this node.java.io.OutputStream
getOutputStream()
Returns an output stream from this leaf.Branch
getParent()
Returns the parent branch of this node.java.lang.String
toString()
-
-
-
Constructor Detail
-
ErrorLeaf
public ErrorLeaf(Branch parent, java.lang.Throwable err)
Constructor.- Parameters:
parent
- leaf parenterr
- the throwable which this leaf reprsents
-
-
Method Detail
-
getParent
public Branch getParent()
Description copied from interface:Node
Returns the parent branch of this node. If this node is at the root of its tree, it will return null.
-
getName
public java.lang.String getName()
Description copied from interface:Node
Returns the name of this node. This should not be an entire pathname, that is, it should not include the name of its parent.
-
getDataSource
public uk.ac.starlink.util.DataSource getDataSource() throws java.io.IOException
Description copied from interface:Leaf
Returns a data source (replayable input stream) containing the data content of this leaf.- Specified by:
getDataSource
in interfaceLeaf
- Returns:
- data source
- Throws:
java.io.IOException
- if some other error occurs
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException
Description copied from interface:Leaf
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).- Specified by:
getOutputStream
in interfaceLeaf
- Returns:
- output stream writing to the file named by this leaf
- Throws:
java.io.IOException
- if there's some error
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-