|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.io.IOUtil
public final class IOUtil
The FileUtil class provides some additional static file management utility methods not contained in java.io.File. The class contains static method only.
| Field Summary | |
|---|---|
static java.lang.String |
CHAR_SET_ISO_8859_1
|
static java.lang.String |
CHAR_SET_UTF_8
|
| Method Summary | |
|---|---|
static java.lang.String |
readTextFile(java.io.File inputFile)
Reads a text file. |
static java.lang.String |
readTextFile(java.io.InputStream in)
Reads a text file stream. |
static java.lang.String |
readTextFile(java.lang.String inputFileName)
Reads a text file. |
static boolean |
writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn)
Write a byte array to file. |
static boolean |
writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn,
boolean append)
Write a byte array to file. |
static boolean |
writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn,
java.lang.String charSet)
Write a byte array to file. |
static boolean |
writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn,
java.lang.String charSet,
boolean append)
Write a byte array to file. |
static boolean |
writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn)
Write a string to file. |
static boolean |
writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn,
boolean append)
Write a string to file. |
static boolean |
writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn,
java.lang.String charSet)
Write a string to file. |
static boolean |
writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn,
java.lang.String charSet,
boolean append)
Write a string to file. |
| 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 CHAR_SET_UTF_8
public static final java.lang.String CHAR_SET_ISO_8859_1
| Method Detail |
|---|
public static java.lang.String readTextFile(java.io.InputStream in)
throws java.io.IOException
in - Inputstream
java.io.IOException - On i/o error
public static java.lang.String readTextFile(java.lang.String inputFileName)
throws java.io.IOException
inputFileName - Name of the file to read
java.io.IOException - On i/o error
public static java.lang.String readTextFile(java.io.File inputFile)
throws java.io.IOException
inputFile - File to read
java.io.IOException - On i/o error
public static boolean writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn)
throws java.io.IOException
outString - String to save; When writing the string, UTF8 encoding will be usedoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retries
java.io.IOException - On error if there is no retry notifier supplied.
public static boolean writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn,
boolean append)
throws java.io.IOException
outString - String to save; When writing the string, UTF8 encoding will be usedoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retriesappend - true The string/byteArray will be appended to the file if the file exists.java.io.IOException - On error if there is no retry notifier supplied.
public static boolean writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn,
java.lang.String charSet)
throws java.io.IOException
outString - String to save; When writing the string, UTF8 encoding will be usedoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retriescharSet - The character set to be used, i.e. UTF-8, ISO 8859-1 etc.
If null, then the UTF-8 character set will be used.
java.io.IOException - On error if there is no retry notifier supplied.
public static boolean writeFile(java.lang.String outputFileName,
java.lang.String outString,
RetryNotifier rn,
java.lang.String charSet,
boolean append)
throws java.io.IOException
outString - String to save; When writing the string, UTF8 encoding will be usedoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retriescharSet - The character set to be used, i.e. UTF-8, ISO 8859-1 etc.
If null, then the UTF-8 character set will be used.append - true The string/byteArray will be appended to the file if the file exists.java.io.IOException - On error if there is no retry notifier supplied.
public static boolean writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn)
throws java.io.IOException
outBytes - Byte array to saveoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retries
java.io.IOException - On error if there is no retry notifier supplied.
public static boolean writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn,
boolean append)
throws java.io.IOException
outBytes - Byte array to saveoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retriesappend - true The string/byteArray will be appended to the file if the file exists.java.io.IOException - On error if there is no retry notifier supplied.
public static boolean writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn,
java.lang.String charSet)
throws java.io.IOException
outBytes - Byte array to saveoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retriescharSet - The character set to be used, i.e. UTF-8, ISO 8859-1 etc.
If null, then the UTF-8 character set will be used.
java.io.IOException - On error if there is no retry notifier supplied.
public static boolean writeFile(java.lang.String outputFileName,
byte[] outBytes,
RetryNotifier rn,
java.lang.String charSet,
boolean append)
throws java.io.IOException
outBytes - Byte array to saveoutputFileName - File namern - Retry notifier object to be called in case of i/o error or null
to suppress retriescharSet - The character set to be used, i.e. UTF-8, ISO 8859-1 etc.
If null, then the UTF-8 character set will be used.append - true The string/byteArray will be appended to the file if the file exists.java.io.IOException - On error if there is no retry notifier supplied.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||