jdepend.framework
Class FileManager

java.lang.Object
  extended by jdepend.framework.FileManager

public class FileManager
extends java.lang.Object

The FileManager class is responsible for extracting Java source and class files (.java and .class files) from a collection of registered directories.

Author:
Mike Clark, Clarkware Consulting, Inc.

Constructor Summary
FileManager()
          Constructs an empty FileManager instance.
 
Method Summary
static boolean acceptClassFile(java.io.File file)
          Indicates whether the specified file is a valid Java class file.
static boolean acceptSourceFile(java.io.File file)
          Indicates whether the specified file is a valid Java source file.
 void addDirectory(java.lang.String name)
          Adds the specified directory to the collection of directories to be managed.
protected  void addFile(java.io.File f)
           
 java.util.Collection extractFiles()
          Extracts the Java source and class files contained in the managed directories.
protected  void extractFiles(java.io.File directory)
          Extracts the Java source and class files contained in the specified directory into the current collection of files.
protected  java.io.File toClassFile(java.io.File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManager

public FileManager()
Constructs an empty FileManager instance.

Method Detail

addDirectory

public void addDirectory(java.lang.String name)
                  throws java.io.IOException
Adds the specified directory to the collection of directories to be managed.

Parameters:
name - Directory name.
Throws:
java.io.IOException - If the directory is invalid.

acceptSourceFile

public static boolean acceptSourceFile(java.io.File file)
Indicates whether the specified file is a valid Java source file.

Parameters:
file - Candidate source file.
Returns:
true if the file is valid; false otherwise.

acceptClassFile

public static boolean acceptClassFile(java.io.File file)
Indicates whether the specified file is a valid Java class file.

Parameters:
file - Candidate class file.
Returns:
true if the file is valid; false otherwise.

extractFiles

public java.util.Collection extractFiles()
Extracts the Java source and class files contained in the managed directories.

Returns:
Collection of source and class files.

extractFiles

protected void extractFiles(java.io.File directory)
Extracts the Java source and class files contained in the specified directory into the current collection of files.

Parameters:
directory - Directory.

addFile

protected void addFile(java.io.File f)

toClassFile

protected java.io.File toClassFile(java.io.File file)


Copyright ? 1999-2002 Clarkware Consulting, Inc. All Rights Reserved.