Class FileCollectionFormatter
java.lang.Object
net.sf.statcvs.renderer.FileCollectionFormatter
Groups a set of file names by directory. Provides a list
of directories in the file set, and lumps directories
with only one file together with its parent directory.
- Version:
- $Id: FileCollectionFormatter.java,v 1.9 2008/04/02 11:22:15 benoitx Exp $
- Author:
- Richard Cyganiak
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance from aCollectionof file names. -
Method Summary
Modifier and TypeMethodDescriptionprotected static intReturns the depth of the directoryGets a list ofStrings containing the directories in the file set, ordered by name.protected static StringgetDirectory(String filename) Returns directory name of specified fileGets the names of all files which reside in a given directory.protected static StringReturns name of parent directory to specified directoryprotected static StringgetRelativeFilename(String filename, String dir) Returns relative filename for specified file and directoryprotected static booleanisInDirectory(String filename, String directory) Returns TRUE if file is in specified directroy, FALSE otherwise
-
Constructor Details
-
FileCollectionFormatter
Creates a new instance from aCollectionof file names.- Parameters:
files- Collection containing the String representations of files
-
-
Method Details
-
getDirectories
Gets a list ofStrings containing the directories in the file set, ordered by name.- Returns:
- a list of
Strings containing the directories in the file set, ordered by name.
-
getFiles
Gets the names of all files which reside in a given directory. The directory must be one from thegetDirectories()list. Files will be relative to the directory. They will be ordered by name.- Parameters:
directory- to process- Returns:
- the names of all files which reside in a given directory.
The directory must be one from the
getDirectories()list. Files will be relative to the directory. They will be ordered by name.
-
isInDirectory
-
getRelativeFilename
-
getDirectory
-
getParent
-
getDepth
Returns the depth of the directory- Parameters:
directory- to be analysed- Returns:
- int the depth of the directory
-