Class ErrorLeaf

java.lang.Object
uk.ac.starlink.connect.ErrorLeaf
All Implemented Interfaces:
Leaf, Node

public class ErrorLeaf extends Object implements Leaf
Dummy Leaf implmentation which describes an error condition.
Since:
9 Sep 2005
Author:
Mark Taylor
  • Constructor Details

    • ErrorLeaf

      public ErrorLeaf(Branch parent, Throwable err)
      Constructor.
      Parameters:
      parent - leaf parent
      err - the throwable which this leaf reprsents
  • Method Details

    • 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.
      Specified by:
      getParent in interface Node
      Returns:
      parent
    • getName

      public 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.
      Specified by:
      getName in interface Node
      Returns:
      name
    • getDataSource

      public uk.ac.starlink.util.DataSource getDataSource() throws IOException
      Description copied from interface: Leaf
      Returns a data source (replayable input stream) containing the data content of this leaf.
      Specified by:
      getDataSource in interface Leaf
      Returns:
      data source
      Throws:
      IOException - if some other error occurs
    • getOutputStream

      public OutputStream getOutputStream() throws 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 interface Leaf
      Returns:
      output stream writing to the file named by this leaf
      Throws:
      IOException - if there's some error
    • toString

      public String toString()
      Overrides:
      toString in class Object