|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ebasetech.ufs.utility.FileUtil
Constructor Summary | |
FileUtil()
|
Method Summary | |
static java.io.File |
createTempFile(java.lang.String prefix,
java.lang.String suffix,
java.io.File near)
Create a temporary file, Slightly smarter version of File.createTempFile |
static byte[] |
rawReadEntireFile(java.io.File fromFile)
read file of bytes without conversion |
static byte[] |
rawReadEntireFile(java.lang.String fromFile)
read file of bytes without conversion |
static java.lang.String |
readEntireFile(java.io.File fromFile)
Get all text in a file. |
static java.lang.String |
readEntireFile(java.io.File fromFile,
java.lang.String encoding)
Get all text in a file. |
static java.lang.String |
readEntireFile(java.lang.String fromFile)
Get all text in a file. |
static java.lang.String |
readEntireFile(java.lang.String fromFile,
java.lang.String encoding)
Get all text in a file. |
static void |
writeEntireFile(java.io.File toFile,
java.lang.String text)
Write all the text in a file |
static void |
writeEntireFile(java.io.File toFile,
java.lang.String text,
java.lang.String encoding)
Write all the text in a file |
static void |
writeEntireFile(java.lang.String toFile,
java.lang.String text)
Write all the text in a file |
static void |
writeEntireFile(java.lang.String toFile,
java.lang.String text,
java.lang.String encoding)
Write all the text in a file |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileUtil()
Method Detail |
public static java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix, java.io.File near) throws java.io.IOException
prefix
- beginning letters of filenamesuffix
- ending letters of filename.near
- directory where to put file, or file to place this temp file near in the same directory.
null means put the temp file in the current directory.
java.io.IOException
public static byte[] rawReadEntireFile(java.io.File fromFile) throws java.io.IOException
fromFile
- file to read
java.io.IOException
public static byte[] rawReadEntireFile(java.lang.String fromFile) throws java.io.IOException
fromFile
- file to read
java.io.IOException
public static java.lang.String readEntireFile(java.io.File fromFile) throws java.io.IOException
fromFile
- file where to get the text.
java.io.IOException
public static java.lang.String readEntireFile(java.io.File fromFile, java.lang.String encoding) throws java.io.IOException, java.io.UnsupportedEncodingException
fromFile
- file where to get the text.encoding
- name of the encoding to use to translate the bytes in
the file
into chars e.g. "windows-1252" "UTF-8" "UTF-16"
java.io.IOException
java.io.UnsupportedEncodingException
- If the named encoding is not supportedpublic static java.lang.String readEntireFile(java.lang.String fromFile) throws java.io.IOException
fromFile
- Name of file where to get the text.
java.io.IOException
public static java.lang.String readEntireFile(java.lang.String fromFile, java.lang.String encoding) throws java.io.IOException, java.io.UnsupportedEncodingException
fromFile
- Name of file where to get the text.encoding
- name of the encoding to use to translate the bytes in
the file
into chars e.g. "windows-1252" "UTF-8" "UTF-16"
java.io.IOException
java.io.UnsupportedEncodingException
- If the named encoding is not supportedpublic static void writeEntireFile(java.io.File toFile, java.lang.String text) throws java.io.IOException
toFile
- file where to write the texttext
- Text to write
java.io.IOException
public static void writeEntireFile(java.io.File toFile, java.lang.String text, java.lang.String encoding) throws java.io.IOException
toFile
- file where to write the texttext
- Text to writeencoding
- name of the encoding to use to translate chars to bytes
e.g.
"windows-1252" "UTF-8" "UTF-16"
java.io.IOException
java.io.UnsupportedEncodingException
- If the named encoding is not supportedpublic static void writeEntireFile(java.lang.String toFile, java.lang.String text) throws java.io.IOException
toFile
- Name of file where to write the texttext
- Text to write
java.io.IOException
public static void writeEntireFile(java.lang.String toFile, java.lang.String text, java.lang.String encoding) throws java.io.IOException
toFile
- file where to write the texttext
- Text to writeencoding
- name of the encoding to use to translate chars to bytes
e.g.
"windows-1252" "UTF-8" "UTF-16"
java.io.IOException
java.io.UnsupportedEncodingException
- If the named encoding is not supported
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |