org.basex.build.fs
Class FSWalker

java.lang.Object
  extended by org.basex.build.fs.FSWalker

public final class FSWalker
extends java.lang.Object

Performs a file hierarchy traversal. An object implementing the interface (@see FSVisitor) may register to the traversal and is called (back) to react on events happening during the traversal (such as entering a directory etc.).

Author:
Workgroup DBIS, University of Konstanz 2007, ISC License, Alexander Holupirek

Field Summary
 java.io.File curr
          Current file to be processed.
 
Constructor Summary
FSWalker()
           
 
Method Summary
 void fileHierarchyTraversal(java.lang.String path)
          Starts the traversal from a given path.
 boolean register(FSVisitor v)
          Registers another visitor to the file hierarchy traversal.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

curr

public java.io.File curr
Current file to be processed.

Constructor Detail

FSWalker

public FSWalker()
Method Detail

fileHierarchyTraversal

public void fileHierarchyTraversal(java.lang.String path)
                            throws java.io.IOException
Starts the traversal from a given path. An empty path or '/' denotes that the complete FS should be parsed. For Windows systems that means (C:/, D:/ ..), for Unix systems '/'.

Parameters:
path - the traversal starts from.
Throws:
java.io.IOException - I/O exception

register

public boolean register(FSVisitor v)
Registers another visitor to the file hierarchy traversal.

Parameters:
v - the visitor to be added.
Returns:
true on success, false on failure.
See Also:
FSVisitor