uk.ac.starlink.srb
Class SRBBranch

java.lang.Object
  extended by uk.ac.starlink.srb.SRBNode
      extended by uk.ac.starlink.srb.SRBBranch
All Implemented Interfaces:
Branch, Node

public class SRBBranch
extends SRBNode
implements Branch

Branch implemenatation based on an SRB file object.

Since:
7 Mar 2005
Author:
Mark Taylor (Starlink)

Constructor Summary
SRBBranch(edu.sdsc.grid.io.srb.SRBFile dir, edu.sdsc.grid.io.srb.SRBFile root)
          Constructor.
 
Method Summary
 Node createNode(String location)
          Attempts to construct a new node in the context of this one.
 Node[] getChildren()
          Returns the array of child nodes belonging to this branch.
 
Methods inherited from class uk.ac.starlink.srb.SRBNode
equals, getFile, getName, getParent, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.connect.Node
getName, getParent
 

Constructor Detail

SRBBranch

public SRBBranch(edu.sdsc.grid.io.srb.SRBFile dir,
                 edu.sdsc.grid.io.srb.SRBFile root)
Constructor. The SRB file object must be a directory. No check is made here though, since SRBFile.isDirectory seems like an incredibly slow call to make.

Parameters:
dir - SRB file object on which this branch is based - must be of type directory
root - the root of the filesystem in which dir lives.
Method Detail

getChildren

public Node[] getChildren()
Description copied from interface: Branch
Returns the array of child nodes belonging to this branch. All the returned values represent file objects which actuallly exist in the filesystem.

Specified by:
getChildren in interface Branch
Returns:
child nodes of this one

createNode

public Node createNode(String location)
Description copied from interface: Branch
Attempts to construct a new node in the context of this one. The new item may represent a new or an existing node in the filesystem. This call should not in itself perform any write operations on the filesystem (such as creating a node which doesn't currently exist), though a subsequent Leaf.getOutputStream() call may do so.

The returned node will typically be a child of this branch, but need not be, for instance if name is interpreted as an absolute path.

If the named node cannot be created, null may be returned.

Specified by:
createNode in interface Branch
Parameters:
location - name of a node in the context of this branch
Returns:
node representing the location of an existing or new node


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.