|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.cobertura.javancss.FileUtil
public class FileUtil
Utility class for file operations.
Simple but most commonly used methods of this class are:
- readFile
- concatPath
Other less frequently used but still handy methods are:
- normalizeFileName to take the current user directory into account via the 'user.dir' system property
| Constructor Summary | |
|---|---|
private |
FileUtil()
Utility class which should never instanciate itself. |
| Method Summary | |
|---|---|
private static java.lang.String |
concatPath(java.lang.String sPath_,
java.lang.String sFile_)
Concatenates a file path with the file name. |
private static java.lang.String |
getAbsoluteFileName(java.lang.String sFileName_)
|
private static boolean |
isAbsolute(java.lang.String sFileName_)
Tests if the file represented by this File object is an absolute pathname. |
static java.lang.String |
normalizeFileName(java.lang.String sFile)
This method returns an absolute (canonical) file name. |
private static java.lang.String |
normalizeFileName(java.lang.String sFile,
java.lang.String sUserDir)
This method returns an absolute (canonical) file name. |
static java.lang.String |
readFile(java.lang.String sFileName_)
Reads a File and returns the content in a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
private FileUtil()
| Method Detail |
|---|
private static java.lang.String concatPath(java.lang.String sPath_,
java.lang.String sFile_)
This method is inspired from the FrIJDE project out of the gCollins.File.FileTools class.
FrIJDE Homepage: http://amber.wpi.edu/~thethe/Document/Besiex/Java/FrIJDE/
sPath_ - a directory path. Is not allowed to be null.sFile_ - the base name of a file.
public static java.lang.String readFile(java.lang.String sFileName_)
throws java.io.IOException,
java.io.FileNotFoundException
sFileName_ - the name of the file to read.
java.io.FileNotFoundException - if file does not exist.
java.io.IOException - if any file operation fails.private static java.lang.String getAbsoluteFileName(java.lang.String sFileName_)
public static java.lang.String normalizeFileName(java.lang.String sFile)
private static java.lang.String normalizeFileName(java.lang.String sFile,
java.lang.String sUserDir)
private static boolean isAbsolute(java.lang.String sFileName_)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||