|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.robocode.io.FileUtil
public class FileUtil
This is a class for file utilization.
| Constructor Summary | |
|---|---|
FileUtil()
|
|
| Method Summary | |
|---|---|
static void |
cleanupStream(java.lang.Object stream)
Cleans up a stream by flushing it and closing it if it is not null. |
static void |
copy(java.io.File srcFile,
java.io.File destFile)
Copies a file into another file. |
static java.io.File |
createDir(java.io.File dir)
Creates a directory if it does not exist already |
static boolean |
deleteDir(java.io.File dir)
Deletes a directory. |
static java.io.File |
getBattlesDir()
Returns the directory containing the battle files. |
static java.lang.String |
getClassName(java.lang.String fileName)
Returns the class name of the specified filename. |
static java.io.File |
getCompilerConfigFile()
Returns the compiler configuration file. |
static java.io.File |
getConfigDir()
Returns the directory containing the configuration files. |
static java.io.File |
getCwd()
Returns the current working directory. |
static java.lang.String |
getFileType(java.io.File file)
Returns the file type of a file, i.e. |
static java.lang.String |
getFileType(java.lang.String fileName)
Returns the file type of a file name, i.e. |
static java.io.File |
getRobocodeConfigFile()
Returns the Robocode configuration file. |
static java.io.File |
getRobotCacheDir()
Returns the directory containing caches files of robots. |
static java.io.File |
getRobotDatabaseFile()
Returns the robot database file. |
static java.io.File |
getRobotsDir()
Returns the directory containing the robots. |
static java.io.File |
getWindowConfigFile()
Returns the window configuration file. |
static java.lang.String |
quoteFileName(java.lang.String filename)
Quotes a file name if it contains white spaces and has not already been quoted. |
static void |
setCwd(java.io.File cwd)
Changes the current working directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileUtil()
| Method Detail |
|---|
public static java.io.File getCwd()
public static void setCwd(java.io.File cwd)
throws java.io.IOException
cwd - a File that is the new working directory
java.io.IOException - if an I/O exception occurspublic static java.lang.String getFileType(java.io.File file)
file - the file
public static java.lang.String getFileType(java.lang.String fileName)
fileName - the file name
public static java.lang.String quoteFileName(java.lang.String filename)
filename - the file to quote
public static void copy(java.io.File srcFile,
java.io.File destFile)
throws java.io.IOException
srcFile - the input file to copydestFile - the output file to copy to
java.io.IOException - if an I/O exception occurspublic static boolean deleteDir(java.io.File dir)
dir - the file for the directory to delete
public static java.io.File createDir(java.io.File dir)
dir - the File that represents the new directory to create.
public static java.lang.String getClassName(java.lang.String fileName)
fileName - the filename to extract the class name from
public static java.io.File getRobotsDir()
public static java.io.File getRobotDatabaseFile()
public static java.io.File getRobotCacheDir()
public static java.io.File getBattlesDir()
public static java.io.File getConfigDir()
public static java.io.File getRobocodeConfigFile()
public static java.io.File getWindowConfigFile()
public static java.io.File getCompilerConfigFile()
public static void cleanupStream(java.lang.Object stream)
stream - the stream to clean up.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||