net.cscott.sinjdoc.parser

Class FileUtil

public class FileUtil extends Object

The FileUtil class contains some useful methods for testing filenames and enumerating source files in packages.

Version: $Id: FileUtil.java,v 1.18 2003/08/11 22:32:39 cananian Exp $

Author: C. Scott Ananian

Method Summary
static List<File>expandFileStar(String str)
Expand a fileglob with the '*' character to a list of matching files.
List<String>expandPackages(List<String> subpackages, List<String> exclude)
Expand the given subpackage and exclude strings to yield a full list of specified packages.
static ReaderfileReader(File f, String encoding, DocErrorReporter reporter)
Return a Reader for the given file using the given encoding.
booleanisValidClassName(String str)
Returns true if the given string is a valid java source file name.
booleanisValidIdentifier(String str)
Returns true if the given string is a valid java identifier.
booleanisValidPackageName(String str)
Returns true if the given string is a valid java package name.
List<File>sourceFilesInPackage(String packageName)
Returns a list of all the source files found in the source path corresponding to the given package name.
static List<String>splitColon(String str)
Split the given string at colons.
static List<String>splitPath(String str)
Split the given string at the path separator character.

Method Detail

expandFileStar

public static List<File> expandFileStar(String str)
Expand a fileglob with the '*' character to a list of matching files.

expandPackages

public List<String> expandPackages(List<String> subpackages, List<String> exclude)
Expand the given subpackage and exclude strings to yield a full list of specified packages.

fileReader

public static Reader fileReader(File f, String encoding, DocErrorReporter reporter)
Return a Reader for the given file using the given encoding. Reports any encoding errors using the given reporter.

isValidClassName

public boolean isValidClassName(String str)
Returns true if the given string is a valid java source file name.

isValidIdentifier

public boolean isValidIdentifier(String str)
Returns true if the given string is a valid java identifier.

isValidPackageName

public boolean isValidPackageName(String str)
Returns true if the given string is a valid java package name.

sourceFilesInPackage

public List<File> sourceFilesInPackage(String packageName)
Returns a list of all the source files found in the source path corresponding to the given package name.

splitColon

public static List<String> splitColon(String str)
Split the given string at colons.

splitPath

public static List<String> splitPath(String str)
Split the given string at the path separator character.
Copyright © 2003 C. Scott Ananian