public class FileManager
extends java.lang.Object
FileManager
class is responsible for
extracting Java source and class files (.java
and .class
files) from a collection of registered
directories.Constructor and Description |
---|
FileManager()
Constructs an empty
FileManager
instance. |
Modifier and Type | Method and Description |
---|---|
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) |
public void addDirectory(java.lang.String name) throws java.io.IOException
name
- Directory name.java.io.IOException
- If the directory is invalid.public static boolean acceptSourceFile(java.io.File file)
file
- Candidate source file.true
if the file is valid;
false
otherwise.public static boolean acceptClassFile(java.io.File file)
file
- Candidate class file.true
if the file is valid;
false
otherwise.public java.util.Collection extractFiles()
protected void extractFiles(java.io.File directory)
directory
- Directory.protected void addFile(java.io.File f)
protected java.io.File toClassFile(java.io.File file)
Copyright ? 1999-2002 Clarkware Consulting, Inc. All Rights Reserved.