ncsa.tools.common.util
Class AbstractScanner

java.lang.Object
  extended byncsa.tools.common.util.AbstractScanner
Direct Known Subclasses:
MethodScanner

public abstract class AbstractScanner
extends java.lang.Object

Functionality adapted and modified from org.apache.tools.ant.FileScanner and org.apache.tools.ant.DirectoryScanner.

Author:
Albert L. Rossi

Method Summary
abstract  void close()
          Closes streams and connections, if any.
abstract  void fullScan()
          Will do a complete scan (i.e., will recur on any scannable parts).
abstract  java.util.List scanNext()
          Stream-like functionality.
 void setDescending(boolean b)
           
 void setFailonerror(boolean b)
           
 void setFullMetadata(boolean b)
          Whether or not the scan should produce complete metadata results or not.
 void setRetainExcluded(boolean b)
           
 void setRetainIncluded(boolean b)
           
 void setRetainNotIncluded(boolean b)
           
abstract  java.util.List shallowScan()
          Will do only a top-level scan, with no recursion.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fullScan

public abstract void fullScan()
                       throws ScanException
Will do a complete scan (i.e., will recur on any scannable parts).

Throws:
ScanException

shallowScan

public abstract java.util.List shallowScan()
                                    throws ScanException
Will do only a top-level scan, with no recursion.

Returns:
list of subparts left to scan.
Throws:
ScanException

scanNext

public abstract java.util.List scanNext()
                                 throws ScanException
Stream-like functionality. Should only be called subsequent to a call to shallowScan (or else it will return nothing).

Returns:
list of subparts left to scan.
Throws:
ScanException

setRetainIncluded

public void setRetainIncluded(boolean b)
Parameters:
b - if true, returned ListResult will contain listings which match an include pattern (default = true).

setRetainExcluded

public void setRetainExcluded(boolean b)
Parameters:
b - if true, returned ListResult will contain listings which match both an include and exclude pattern (default = false).

setRetainNotIncluded

public void setRetainNotIncluded(boolean b)
Parameters:
b - if true, returned ListResult will contain listings which do not match any of the includes patterns (default = false).

setDescending

public void setDescending(boolean b)
Parameters:
b - if true, sorts in descending order (default = false).

setFullMetadata

public void setFullMetadata(boolean b)
Whether or not the scan should produce complete metadata results or not. If this flag is false, methods returning metadata objects should return an empty array.

Parameters:
b - if true, stores full metadata object; else stores only the path / name (default = false).

setFailonerror

public void setFailonerror(boolean b)
Parameters:
b - if true, and the file or directory does not exist, causes scanner to throw an exception.

close

public abstract void close()
Closes streams and connections, if any.