com.mcdermottroe.exemplar.utils
Class Files

java.lang.Object
  extended by com.mcdermottroe.exemplar.utils.Files

public final class Files
extends Object

A collection of File handling methods.

Since:
0.2

Constructor Summary
private Files()
          Private constructor to prevent instantiation of this class.
 
Method Summary
static Collection<File> findDirectories(File directory)
          Find all the subdirectories of a directory.
static Collection<File> findFiles(File directory)
          Find all files under a directory.
static void removeTree(File directory)
          Remove a tree of files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Files

private Files()
Private constructor to prevent instantiation of this class.

Method Detail

removeTree

public static void removeTree(File directory)
Remove a tree of files.

Parameters:
directory - The root directory of the tree to remove.

findFiles

public static Collection<File> findFiles(File directory)
Find all files under a directory.

Parameters:
directory - The directory to search.
Returns:
The Files found under the directory.

findDirectories

public static Collection<File> findDirectories(File directory)
Find all the subdirectories of a directory.

Parameters:
directory - The directory to search.
Returns:
The Files found under the directory which are directories. directory is included in the returned Collection.