|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.cke.util.FileUtilities
Contains some basic file utilities that could be very handy in certain situations.
Constructor Summary | |
FileUtilities()
|
Method Summary | |
static boolean |
delFile(java.lang.String filename)
Deletes the specified file or directory if exists. |
static boolean |
exists(java.lang.String pathname)
Checks that the specified pathname is an existing file or directory. |
static java.lang.String |
getDirContent(java.lang.String pathname)
Gets the filenames and directories of the specified directory |
static java.lang.String |
getFileFormatedDate()
A method that returns a date formatted as "yyyyMMddHHmmssSSS". |
static java.lang.String |
getLogFormatedDate()
A method that returns a date formatted as "yyyy-MM-dd HH:mm:ss:SSS". |
static boolean |
isDirectory(java.lang.String pathname)
Checks if the specified pathname is a directory |
static boolean |
isFile(java.lang.String filename)
Checks if the specified filename is a file |
static java.lang.String |
readFromFile(java.lang.String filename)
Gets the content of the specified file in string format |
static java.lang.String |
setPathSlash(java.lang.String path)
A method that guaranties that a directory path ends with a slash. |
static java.lang.String |
setXMLOutputFormat(java.lang.String path,
java.lang.String name)
A method that returns a filename formatted as "[path]/yyyyMMddHHmmssSSS-[Name].xml". |
static boolean |
writeToFile(java.lang.String filename,
java.lang.String content)
Writes the content to the specified file. |
static boolean |
writeToFile(java.lang.String filename,
java.lang.String content,
boolean append)
Writes the content to the specified file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileUtilities()
Method Detail |
public static java.lang.String getLogFormatedDate()
public static java.lang.String getFileFormatedDate()
public static java.lang.String setPathSlash(java.lang.String path)
path
- the path to check and alter
public static java.lang.String setXMLOutputFormat(java.lang.String path, java.lang.String name)
path
- of the filename
- of the file
public static boolean exists(java.lang.String pathname)
pathname
- of the specified file or directory
public static boolean isDirectory(java.lang.String pathname)
pathname
- the pathname to check
public static boolean isFile(java.lang.String filename)
filename
- the filename to check
public static boolean delFile(java.lang.String filename)
public static java.lang.String readFromFile(java.lang.String filename)
filename
- name of the specified file
public static java.lang.String getDirContent(java.lang.String pathname)
pathname
- of the specified directory
public static boolean writeToFile(java.lang.String filename, java.lang.String content, boolean append)
filename
- name of the specified filecontent
- that should be written to the specified fileappend
- true if append to file if it exist or false if overwrite the file if it exist
public static boolean writeToFile(java.lang.String filename, java.lang.String content)
filename
- name of the specified filecontent
- that should be written to the specified file
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |