com.mysql.management.util
Class Files
java.lang.Object
com.mysql.management.util.Files
public class Files
- extends java.lang.Object
- Version:
- $Id: Files.java,v 1.2 2005/12/01 21:45:31 eherman Exp $
- Author:
- Eric Herman
|
Constructor Summary |
Files()
|
|
Method Summary |
void |
addExecutableRights(java.io.File executable,
java.io.PrintStream out,
java.io.PrintStream err)
On UNIX systems, in order for a file to be executable, it needs to have
the execute bit set. |
java.lang.String |
asString(java.io.File file)
|
boolean |
cleanTestDir()
|
java.io.File |
cononical(java.io.File file)
|
boolean |
deleteTree(java.io.File file)
Depth First traversal of the directory. |
java.lang.String |
getPath(java.io.File file)
|
boolean |
isEmpty(java.io.File dir)
|
boolean |
isWindows()
|
java.io.File |
newFile(java.lang.Object fileName)
|
java.io.File |
nullFile()
|
java.io.File |
testDir()
|
java.io.File |
tmp()
|
java.io.File |
tmp(java.lang.String subdir)
|
java.io.File |
validCononicalDir(java.io.File dir)
|
java.io.File |
validCononicalDir(java.io.File dir,
java.io.File defaultDir)
|
void |
writeString(java.io.File file,
java.lang.String str)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JAVA_IO_TMPDIR
public static final java.lang.String JAVA_IO_TMPDIR
- See Also:
- Constant Field Values
USE_TEST_DIR
public static final java.lang.String USE_TEST_DIR
- See Also:
- Constant Field Values
Files
public Files()
testDir
public java.io.File testDir()
tmp
public java.io.File tmp()
tmp
public java.io.File tmp(java.lang.String subdir)
deleteTree
public boolean deleteTree(java.io.File file)
- Depth First traversal of the directory. Attempts to delete every file in
the structure.
- Returns:
- true if the file passed in is successfully deleted
addExecutableRights
public void addExecutableRights(java.io.File executable,
java.io.PrintStream out,
java.io.PrintStream err)
- On UNIX systems, in order for a file to be executable, it needs to have
the execute bit set. This method executes a "chmod +x filename"
isWindows
public boolean isWindows()
asString
public java.lang.String asString(java.io.File file)
writeString
public void writeString(java.io.File file,
java.lang.String str)
nullFile
public java.io.File nullFile()
newFile
public java.io.File newFile(java.lang.Object fileName)
cononical
public java.io.File cononical(java.io.File file)
getPath
public java.lang.String getPath(java.io.File file)
cleanTestDir
public boolean cleanTestDir()
validCononicalDir
public java.io.File validCononicalDir(java.io.File dir,
java.io.File defaultDir)
validCononicalDir
public java.io.File validCononicalDir(java.io.File dir)
isEmpty
public boolean isEmpty(java.io.File dir)
Copyright © 2004-2011. All Rights Reserved.