|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.toolforge.core.util.file.MyFileUtils
File utilities. Stuff that is not implemented by org.apache.commons.io.FileUtils
.
Constructor Summary | |
MyFileUtils()
|
Method Summary | |
static java.io.File |
createTempDirectory()
Creates a temporary directory with some random positive long as its name. |
static java.io.File |
getSystemTempDirectory()
|
static void |
makeReadOnly(java.io.File dir)
Makes all files in dir and all its subdirectories read-only. |
static void |
makeWriteable(java.io.File target,
boolean recurse)
Makes the specified file or directory writeable. |
static void |
writeFile(java.io.File dir,
java.io.File fileRef,
java.io.File newFileName,
java.lang.ClassLoader classLoader)
Writes fileRef to dir as newFileRef . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MyFileUtils()
Method Detail |
public static java.io.File getSystemTempDirectory()
public static java.io.File createTempDirectory() throws java.io.IOException
long
as its name.
File
reference to the temporary directory.
java.io.IOException
- When some IO error occurred.public static void makeWriteable(java.io.File target, boolean recurse) throws java.io.IOException, java.lang.InterruptedException
recurse
parameter is true and the specified target is a directory, this method will
recurse into subdirectories.
target
- File or directory to make writeable.recurse
-
java.io.IOException
java.lang.InterruptedException
public static void makeReadOnly(java.io.File dir)
dir
and all its subdirectories read-only. Uses the Ant
DirectoryScanner
.
dir
- Starting directory.public static void writeFile(java.io.File dir, java.io.File fileRef, java.io.File newFileName, java.lang.ClassLoader classLoader) throws java.io.IOException
fileRef
to dir
as newFileRef
. fileRef
should be available in the classpath of
classLoader
.
dir
- The directory to write tofileRef
- The original filename (path)newFileName
- The new filenameclassLoader
- The class loader that contains fileRef
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |