|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jostraca.util.FileUtil
File handling utility methods.
| Nested Class Summary | |
static interface |
FileUtil.FileNameFilter
|
| Field Summary | |
static boolean |
BINARY_FILE
|
static java.lang.String |
CN
|
static boolean |
EMPTY_IF_IO_ERROR
|
static boolean |
FAIL_ON_IO_ERROR
|
static java.io.FileFilter |
sElideDotFolders
|
static boolean |
TEXT_FILE
|
| Constructor Summary | |
FileUtil()
|
|
| Method Summary | |
static void |
copyFile(java.io.File pFromPath,
java.io.File pToPath)
|
static void |
copyFile(java.io.File pFromPath,
java.lang.String pToPath)
|
static void |
copyFile(java.lang.String pFromPath,
java.io.File pToPath)
|
static void |
copyFile(java.lang.String pFromPath,
java.lang.String pToPath)
|
static void |
ensureFolder(java.io.File pFile)
Ensure folder exists |
static void |
ensureParentFolder(java.io.File pFile)
Ensure parent folder exists |
static java.io.File |
findFile(java.lang.String pPathRef)
Find a file in the classpath. |
static java.lang.String |
getExtension(java.lang.String pFileName)
get extension suffix from file name |
static java.lang.String |
getParent(java.io.File pPath)
|
static java.lang.String |
getParent(java.io.File pPath,
java.lang.String pDefaultParent)
Get parent folder of specified path. |
static java.lang.String |
getParent(java.lang.String pPath)
|
static long |
lastMod(java.io.File pPath)
get last mode time of a file |
static long |
lastMod(java.lang.String pPath)
get last mode time of a file |
static java.lang.String |
readFile(java.io.File pFile)
Read a file using File object. |
static java.lang.String |
readFile(java.io.File pFile,
boolean pFailOnIOError)
Read a file using File onject. |
static java.lang.String |
readFile(java.lang.String pFilePath)
Read a file using path. |
static java.lang.String |
readFile(java.lang.String pFilePath,
boolean pFailOnIOError)
Read a file using path. |
static byte[] |
readRawData(java.io.File pFile)
|
static byte[] |
readRawData(java.lang.String pFilePath)
|
static java.io.File[] |
recursiveSearch(java.io.File pRootFolder,
FileUtil.FileNameFilter pFileNameFilter)
|
static java.lang.String |
removeExtension(java.lang.String pFileName)
remove extension suffix from file name |
static void |
writeBinaryFile(java.io.File pFile,
java.lang.String pText)
|
static void |
writeBinaryFile(java.lang.String pPath,
java.lang.String pText)
|
static void |
writeFile(java.io.File pFile,
java.lang.String pText)
|
static void |
writeFile(java.lang.String pPath,
java.lang.String pText)
|
static void |
writeRawData(java.io.File pFile,
byte[] pData)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String CN
public static final boolean FAIL_ON_IO_ERROR
public static final boolean EMPTY_IF_IO_ERROR
public static final boolean TEXT_FILE
public static final boolean BINARY_FILE
public static final java.io.FileFilter sElideDotFolders
| Constructor Detail |
public FileUtil()
| Method Detail |
public static java.lang.String readFile(java.io.File pFile,
boolean pFailOnIOError)
throws java.io.IOException
pFile - file to readpFailOnIOError - true => throws IOException on IO error.
java.io.IOException
public static java.lang.String readFile(java.io.File pFile)
throws java.io.IOException
pFile - File object to read.
java.io.IOException
public static java.lang.String readFile(java.lang.String pFilePath,
boolean pFailOnIOError)
throws java.io.IOException
pFilePath - Path to file.pFailOnIOError - true => throws IOException on IO error.
java.io.IOException
public static java.lang.String readFile(java.lang.String pFilePath)
throws java.io.IOException
pFilePath - Path to file.
java.io.IOException
public static byte[] readRawData(java.lang.String pFilePath)
throws java.io.IOException
java.io.IOException
public static byte[] readRawData(java.io.File pFile)
throws java.io.IOException
java.io.IOException
public static final long lastMod(java.lang.String pPath)
throws java.io.IOException
java.io.IOException
public static final long lastMod(java.io.File pPath)
throws java.io.IOException
java.io.IOException
public static void writeBinaryFile(java.io.File pFile,
java.lang.String pText)
throws java.io.IOException
java.io.IOException
public static void writeFile(java.io.File pFile,
java.lang.String pText)
throws java.io.IOException
java.io.IOException
public static void writeBinaryFile(java.lang.String pPath,
java.lang.String pText)
throws java.io.IOException
java.io.IOException
public static void writeFile(java.lang.String pPath,
java.lang.String pText)
throws java.io.IOException
java.io.IOException
public static void writeRawData(java.io.File pFile,
byte[] pData)
throws java.io.IOException
java.io.IOException
public static void copyFile(java.lang.String pFromPath,
java.lang.String pToPath)
throws java.io.IOException
java.io.IOException
public static void copyFile(java.lang.String pFromPath,
java.io.File pToPath)
throws java.io.IOException
java.io.IOException
public static void copyFile(java.io.File pFromPath,
java.lang.String pToPath)
throws java.io.IOException
java.io.IOException
public static void copyFile(java.io.File pFromPath,
java.io.File pToPath)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String getParent(java.io.File pPath)
getParent( File, String )public static java.lang.String getParent(java.lang.String pPath)
getParent( File, String )
public static java.lang.String getParent(java.io.File pPath,
java.lang.String pDefaultParent)
pPath - file pathpDefaultParent - default parent file path if no parent
public static final void ensureParentFolder(java.io.File pFile)
throws java.io.IOException
java.io.IOException
public static final void ensureFolder(java.io.File pFile)
throws java.io.IOException
java.io.IOExceptionpublic static final java.lang.String getExtension(java.lang.String pFileName)
public static final java.lang.String removeExtension(java.lang.String pFileName)
public static java.io.File findFile(java.lang.String pPathRef)
throws java.lang.Exception
pPathRef - relative path reference
java.lang.Exception
public static java.io.File[] recursiveSearch(java.io.File pRootFolder,
FileUtil.FileNameFilter pFileNameFilter)
throws java.io.IOException
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||