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.DataSourcegetDataSource()Returns a data source (replayable input stream) containing the data content of this leaf.java.lang.StringgetName()Returns the name of this node.java.io.OutputStreamgetOutputStream()Returns an output stream from this leaf.BranchgetParent()Returns the parent branch of this node.java.lang.StringtoString()
-
-
-
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:NodeReturns 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:NodeReturns 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.IOExceptionDescription copied from interface:LeafReturns a data source (replayable input stream) containing the data content of this leaf.- Specified by:
getDataSourcein interfaceLeaf- Returns:
- data source
- Throws:
java.io.FileNotFoundException- if the file named by this leaf does not existjava.io.IOException- if some other error occurs
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOExceptionDescription copied from interface:LeafReturns 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:
getOutputStreamin 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:
toStringin classjava.lang.Object
-
-