|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jagatoo.util.io.FileUtils
public class FileUtils
Utility methods for files.
Method Summary | |
---|---|
static void |
copyFile(java.io.File source,
java.io.File dest)
Copies one file to another one. |
static void |
deleteFolderRecursively(java.io.File path)
Deletes directory at path recursively. |
static void |
deleteFolderRecursively(java.io.File path,
boolean includeSelf)
Deletes directory at path recursively. |
static void |
deleteFolderRecursively(java.lang.String path)
Deletes directory at path recursively. |
static void |
deleteFolderRecursively(java.lang.String path,
boolean includeSelf)
Deletes directory at path recursively. |
static java.io.File |
getCanonicalFile(java.io.File file)
|
static java.io.File |
getCanonicalFile(java.lang.String filename)
Returns the canonical representation of the given file using File.getCanonicalFile() . |
static byte[] |
getFileAsByteArray(java.io.File file)
Reads text-file file and returns contents as one big byte-array. |
static java.lang.String |
getFileAsString(java.io.File file)
Reads text-file file and returns contents as one big string. |
static java.lang.String |
getFileAsString(java.io.File file,
java.nio.charset.Charset charset)
|
static java.lang.String |
getFileAsString(java.io.File file,
java.lang.String charset_name)
|
static void |
writeStringToFile(java.lang.CharSequence contents,
java.io.File file)
writes string contents to file file |
static void |
writeStringToFile(java.lang.CharSequence contents,
java.lang.String filename)
writes string contents to file file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void copyFile(java.io.File source, java.io.File dest) throws java.io.IOException
source
- dest
-
java.io.IOException
public static void deleteFolderRecursively(java.io.File path, boolean includeSelf) throws java.io.IOException
path
- includeSelf
- also delete the passed directory itself?
java.io.IOException
public static void deleteFolderRecursively(java.lang.String path, boolean includeSelf) throws java.io.IOException
path
- includeSelf
- also delete the passed directory itself?
java.io.IOException
public static void deleteFolderRecursively(java.io.File path) throws java.io.IOException
path
-
java.io.IOException
public static void deleteFolderRecursively(java.lang.String path) throws java.io.IOException
path
-
java.io.IOException
public static void writeStringToFile(java.lang.CharSequence contents, java.io.File file) throws java.io.IOException
contents
- file
-
java.io.IOException
public static void writeStringToFile(java.lang.CharSequence contents, java.lang.String filename) throws java.io.IOException
contents
- filename
-
java.io.IOException
public static byte[] getFileAsByteArray(java.io.File file) throws java.io.IOException
file
-
java.io.IOException
public static java.lang.String getFileAsString(java.io.File file) throws java.io.IOException
file
-
java.io.IOException
public static java.lang.String getFileAsString(java.io.File file, java.lang.String charset_name) throws java.io.IOException, java.io.UnsupportedEncodingException
file
- charset_name
-
java.io.IOException
java.io.UnsupportedEncodingException
public static java.lang.String getFileAsString(java.io.File file, java.nio.charset.Charset charset) throws java.io.IOException
file
- charset
-
java.io.IOException
public static final java.io.File getCanonicalFile(java.io.File file)
public static final java.io.File getCanonicalFile(java.lang.String filename)
File.getCanonicalFile()
.
If this fails, the result of File.getAbsoluteFile()
is returned.
filename
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |