org.eclipse.actf.util
Class FileUtils

java.lang.Object
  extended by org.eclipse.actf.util.FileUtils

public class FileUtils
extends Object


Constructor Summary
protected FileUtils()
          Constructor a no argument protected constructor
 
Method Summary
static void copyFile(FileInputStream source, FileOutputStream dest)
          copy a file
static void copyFiles(File baseDir, File newParent, String pattern)
          Copy files matching a certain pattern from one directory to another
static void deleteFiles(File baseDir, String pattern)
          delete files or directories matching a specified pattern
static void findFiles(FilenameFilter filter, File baseDir, List fileList)
          Find files matching a specified pattern in a specified location
static File[] findFiles(String fileDesc, File baseDir)
          Find files matching a specified pattern in a specified location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

protected FileUtils()
Constructor a no argument protected constructor

Method Detail

deleteFiles

public static void deleteFiles(File baseDir,
                               String pattern)
delete files or directories matching a specified pattern

Parameters:
baseDir - - root directory from which to start - must be existing directory
pattern - - the pattern of file names to erase

copyFiles

public static void copyFiles(File baseDir,
                             File newParent,
                             String pattern)
Copy files matching a certain pattern from one directory to another

Parameters:
baseDir - - the directory to copy from - must be existing
newParent - - the directory to copy to - must be existing
pattern - - the pattern of files to copy

findFiles

public static File[] findFiles(String fileDesc,
                               File baseDir)
Find files matching a specified pattern in a specified location

Parameters:
fileDesc - - the filename pattern you are searching for
baseDir - - the directory to search - must be existing
Returns:
array of files

findFiles

public static void findFiles(FilenameFilter filter,
                             File baseDir,
                             List fileList)
Find files matching a specified pattern in a specified location

Parameters:
filter - - filename filter of matching pattern
baseDir - - the directory from which to start the search
fileList - - a Linked List where the found files will be returned

copyFile

public static void copyFile(FileInputStream source,
                            FileOutputStream dest)
                     throws IOException
copy a file

Parameters:
source - - the source file input stream
dest - - the destination file output stream
Throws:
IOException