sam.entry
Class FileSystem

java.lang.Object
  |
  +--sam.entry.Enumerator
        |
        +--sam.entry.FileSystem
All Implemented Interfaces:
java.util.Enumeration

public class FileSystem
extends Enumerator

Enumerates local files and recurse sub-directories


Field Summary
 
Fields inherited from class sam.entry.Enumerator
EMPTY
 
Constructor Summary
FileSystem(java.io.File baseDirectory)
          Builds a new file system enumerator which enumerates files in specified directory
FileSystem(java.io.File baseDirectory, boolean listDirectories)
          Builds a new file system enumerator which enumerates files in specified directory
FileSystem(java.io.File baseDirectory, boolean listDirectories, boolean keepDirectoryName)
          Builds a new file system enumerator.
FileSystem(java.lang.String baseDirectory)
          Builds a new file system enumerator which enumerates files in specified directory
 
Method Summary
 boolean hasMoreElements()
          Wether this Enumerator has more elements
 sam.entry.Entry nextEntry()
          Gets next entry, or null if none
static sam.entry.Enumerator scan(java.io.File directory, java.lang.String[] specifications)
          Scans for file names specifications (wildcards allowed).
static sam.entry.Enumerator scan(java.lang.String[] specifications)
          Enumerates specified files.
 java.lang.String toString()
           
 
Methods inherited from class sam.entry.Enumerator
filter, filter, isEmpty, load, nextElement, println, println, statify, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSystem

public FileSystem(java.lang.String baseDirectory)
Builds a new file system enumerator which enumerates files in specified directory

Note that directories are not listed themselves


FileSystem

public FileSystem(java.io.File baseDirectory)
Builds a new file system enumerator which enumerates files in specified directory

Note that directories are not listed themselves


FileSystem

public FileSystem(java.io.File baseDirectory,
                  boolean listDirectories)
Builds a new file system enumerator which enumerates files in specified directory

Parameters:
listDirectories - wether directories are to be listed themselves

FileSystem

public FileSystem(java.io.File baseDirectory,
                  boolean listDirectories,
                  boolean keepDirectoryName)
Builds a new file system enumerator.

Parameters:
baseDirectory - the single file or directory to scan recursively.
listDirectories - wether or not to include directories themselves in the enumeration.
keepDirectoryName - wether or not to keep the base directory name in enumerated names
Method Detail

scan

public static sam.entry.Enumerator scan(java.io.File directory,
                                        java.lang.String[] specifications)
Scans for file names specifications (wildcards allowed). Scans all files matching specifications recursively from directory.

See Also:
Moreover the file-system scanning is lazy until a call to nextEntry() or to statify()

scan

public static sam.entry.Enumerator scan(java.lang.String[] specifications)
Enumerates specified files. Each member of specifications must be either a proper file name or a proper readable directory. In particular wildcards are not allowed here. Moreover the file-system scanning is lazy until a call to nextEntry() or to statify()


nextEntry

public sam.entry.Entry nextEntry()
Description copied from class: Enumerator
Gets next entry, or null if none

Specified by:
nextEntry in class Enumerator

hasMoreElements

public boolean hasMoreElements()
Description copied from class: Enumerator
Wether this Enumerator has more elements

Specified by:
hasMoreElements in interface java.util.Enumeration
Specified by:
hasMoreElements in class Enumerator

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object