uk.ac.ed.inf.ogsaconfig.garm.util
Class FileUtils

java.lang.Object
  |
  +--uk.ac.ed.inf.ogsaconfig.garm.util.FileUtils

public final class FileUtils
extends java.lang.Object

This is a collection of static methods to make working with the Java file API more straightforward.


Method Summary
static boolean copyFile(java.io.File src, java.io.File dest)
           
static java.io.File createTempDir()
          creates a temporary directory
static java.io.File makeFile(java.io.File parent, java.io.File child)
          creates a new file with the given hierarchy
static java.io.File makeFile(java.io.File parent, java.lang.String child)
          creates a new file with the given hierarchy
static java.io.File makeFile(java.lang.String parent, java.io.File child)
          creates a new file with the given hierarchy
static java.io.File makeFile(java.lang.String parent, java.lang.String child)
          creates a new file with the given hierarchy
static boolean matchPrefix(java.io.File prefix, java.io.File hierarchy)
          returns true if the file is contained in prefix
static boolean matchPrefix(java.io.File prefix, java.lang.String hierarchy)
          returns true if the file is contained in prefix
static boolean matchPrefix(java.lang.String prefix, java.io.File hierarchy)
          returns true if the file is contained in prefix
static boolean matchPrefix(java.lang.String prefix, java.lang.String hierarchy)
          returns true if the file is contained in prefix
static java.io.File stripPrefix(java.io.File prefix, java.io.File hierarchy)
          makes a file which is relative to the given prefix
static java.io.File stripPrefix(java.io.File prefix, java.lang.String hierarchy)
          makes a file which is relative to the given prefix
static java.io.File stripPrefix(java.lang.String prefix, java.io.File hierarchy)
          makes a file which is relative to the given prefix
static java.io.File stripPrefix(java.lang.String prefix, java.lang.String hier)
          makes a file which is relative to the given prefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copyFile

public static boolean copyFile(java.io.File src,
                               java.io.File dest)
                        throws java.io.IOException
java.io.IOException

createTempDir

public static java.io.File createTempDir()
                                  throws java.io.IOException
creates a temporary directory

java.io.IOException

makeFile

public static java.io.File makeFile(java.lang.String parent,
                                    java.io.File child)
creates a new file with the given hierarchy


makeFile

public static java.io.File makeFile(java.io.File parent,
                                    java.io.File child)
creates a new file with the given hierarchy


makeFile

public static java.io.File makeFile(java.io.File parent,
                                    java.lang.String child)
creates a new file with the given hierarchy


makeFile

public static java.io.File makeFile(java.lang.String parent,
                                    java.lang.String child)
creates a new file with the given hierarchy


stripPrefix

public static java.io.File stripPrefix(java.io.File prefix,
                                       java.io.File hierarchy)
makes a file which is relative to the given prefix


stripPrefix

public static java.io.File stripPrefix(java.io.File prefix,
                                       java.lang.String hierarchy)
makes a file which is relative to the given prefix


stripPrefix

public static java.io.File stripPrefix(java.lang.String prefix,
                                       java.io.File hierarchy)
makes a file which is relative to the given prefix


stripPrefix

public static java.io.File stripPrefix(java.lang.String prefix,
                                       java.lang.String hier)
makes a file which is relative to the given prefix


matchPrefix

public static boolean matchPrefix(java.io.File prefix,
                                  java.io.File hierarchy)
returns true if the file is contained in prefix


matchPrefix

public static boolean matchPrefix(java.io.File prefix,
                                  java.lang.String hierarchy)
returns true if the file is contained in prefix


matchPrefix

public static boolean matchPrefix(java.lang.String prefix,
                                  java.io.File hierarchy)
returns true if the file is contained in prefix


matchPrefix

public static boolean matchPrefix(java.lang.String prefix,
                                  java.lang.String hierarchy)
returns true if the file is contained in prefix