org.pf.file
Class FileDirectoryScanner

java.lang.Object
  extended byorg.pf.file.FileDirectoryScanner

public class FileDirectoryScanner
extends java.lang.Object

This scanner starts at a specified base directory and collects information about all contained files and sub directories and their contained files and so on.
As a result it returns a TableOfContents object that contains all the collected information.

Version:
1.0
Author:
Manfred Duchrow

Constructor Summary
FileDirectoryScanner()
          Initialize the new instance with default values.
 
Method Summary
 TableOfContents scanDirectory(java.lang.String dir)
          Scan the specified directory and return the table of contents that holds information about all found sub directories and files.
 TableOfContents scanDirectory(java.lang.String dir, java.lang.String filePattern)
          Scan the specified directory and return the table of contents that holds information about all found sub directories and all files that match the specified pattern.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDirectoryScanner

public FileDirectoryScanner()
Initialize the new instance with default values.

Method Detail

scanDirectory

public TableOfContents scanDirectory(java.lang.String dir)
                              throws java.io.IOException
Scan the specified directory and return the table of contents that holds information about all found sub directories and files. All found directories are relative to the given start directory.

Parameters:
dir - The directory from which to start the scan
Throws:
java.io.IOException - If the start directory doesn't exist or is no directory

scanDirectory

public TableOfContents scanDirectory(java.lang.String dir,
                                     java.lang.String filePattern)
                              throws java.io.IOException
Scan the specified directory and return the table of contents that holds information about all found sub directories and all files that match the specified pattern. All found directories are relative to the given start directory.

Parameters:
dir - The directory from which to start the scan
filePattern - A pattern for the files to include into the TOC
Throws:
java.io.IOException - If the start directory doesn't exist or is no directory