|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ebasetech.xi.services.FileServices
public class FileServices
File services
| Constructor Summary | |
|---|---|
FileServices()
|
|
| Method Summary | |
|---|---|
static boolean |
copyFile(java.lang.String fromPath,
java.lang.String toPath)
Copies the contents of the file represented by fromPath to toPath. |
static boolean |
createNewDirectory(java.lang.String filePath)
Creates a new directory with this path name so long as a file or directory doesn't already exist with the same name. |
static boolean |
createNewFile(java.lang.String filePath)
Creates a new file with this path name so long as a file or directory doesn't already exist with the same name. |
static boolean |
deleteFile(java.lang.String filePath)
Deletes the file or directory with this path name. |
static boolean |
existsFile(java.lang.String filePath)
Returns true if a file or directory with this path name exists. |
static java.lang.String |
getAbsoluteFilePath(java.lang.String filePath)
Returns an absolute file path for the specified relative or absolute file path. |
static java.lang.String |
getParentPath(java.lang.String filePath)
Returns the path name of this file's parent directory or null if no parent exists. |
static java.lang.String |
getSeparator()
Returns the system dependent file separator character. |
static java.lang.String |
getWebAppRootFilePath()
Returns the file path for the root directory served by Http requests for the web application. |
static boolean |
isDirectory(java.lang.String filePath)
Returns true if file path represents a directory. |
static boolean |
isFile(java.lang.String filePath)
Returns true if file path represents a file. |
static java.lang.String[] |
listFilesInDirectory(java.lang.String filePath)
Returns an array of file paths for all files and directories within the directory represented by file path. |
static boolean |
moveFile(java.lang.String fromPath,
java.lang.String toPath)
Moves the file specified by fromPath to the path specified by toPath. |
static java.lang.String |
readFile(java.lang.String filePath)
Returns a String value representing the contents of the file specified by file path. |
static java.lang.String |
readFile(java.lang.String filePath,
java.lang.String encoding)
Returns a String value representing the contents of the file specified by file path decoded using the specified encoding. |
static void |
writeFile(java.lang.String filePath,
java.lang.String text)
Creates a new file if necessary with the specified file path and saves the file with the specified text. |
static void |
writeFile(java.lang.String filePath,
java.lang.String text,
java.lang.String encoding)
Creates a new file if necessary with the specified file path and saves the file with the specified text decoded using the specified encoding. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileServices()
| Method Detail |
|---|
public static boolean createNewDirectory(java.lang.String filePath)
filePath - for the new directory
java.io.IOException - if an error occurs
public static boolean createNewFile(java.lang.String filePath)
throws java.io.IOException
filePath - file path for the new file
java.io.IOException - if an error occurspublic static boolean deleteFile(java.lang.String filePath)
filePath - to be deleted
java.io.IOException - if an error occurspublic static boolean existsFile(java.lang.String filePath)
filePath -
public static java.lang.String getParentPath(java.lang.String filePath)
filePath -
public static boolean isDirectory(java.lang.String filePath)
filePath -
public static boolean isFile(java.lang.String filePath)
filePath -
public static java.lang.String[] listFilesInDirectory(java.lang.String filePath)
filePath -
public static java.lang.String readFile(java.lang.String filePath)
throws java.io.IOException
filePath -
java.io.IOException - if an error occurs
public static java.lang.String readFile(java.lang.String filePath,
java.lang.String encoding)
throws java.io.IOException
filePath - encoding - character set name
java.io.IOException - if an error occurs
public static boolean moveFile(java.lang.String fromPath,
java.lang.String toPath)
throws java.io.IOException
fromPath - the file to be renamedtoPath - the new name
java.io.IOException - if an error occurs
public static void writeFile(java.lang.String filePath,
java.lang.String text)
throws java.io.IOException
filePath - text - text to be saved
java.io.IOException - if an error occurs
public static void writeFile(java.lang.String filePath,
java.lang.String text,
java.lang.String encoding)
throws java.io.IOException
filePath - text - text to be savedencoding - character set name
java.io.IOException - if an error occurs
public static boolean copyFile(java.lang.String fromPath,
java.lang.String toPath)
throws java.io.IOException
fromPath - the file to be copiedtoPath - the target file
java.io.IOException - if an error occurspublic static java.lang.String getSeparator()
public static java.lang.String getWebAppRootFilePath()
public static java.lang.String getAbsoluteFilePath(java.lang.String filePath)
throws java.io.IOException
filePath -
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||