|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mirth.connect.server.userutil.FileUtil
public class FileUtil
Provides file utility methods.
FileUtils
Method Summary | |
---|---|
static byte[] |
decode(java.lang.String data)
Decodes a Base64 string into octets. |
static boolean |
deleteFile(java.io.File file)
Deletes a specified File. |
static java.lang.String |
encode(byte[] data)
Encoded binary data into a Base64 string. |
static java.lang.String |
read(java.lang.String fileName)
Returns the contents of the file as a string, using the system default charset encoding. |
static byte[] |
readBytes(java.lang.String fileName)
Returns the contents of the file as a byte array. |
static java.lang.String |
rtfToPlainText(java.lang.String message,
java.lang.String replaceLinebreaksWith)
Converts an RTF into plain text using the Swing RTFEditorKit. |
static void |
write(java.lang.String fileName,
boolean append,
byte[] bytes)
Writes a byte array to a file, creating the file if it does not exist. |
static void |
write(java.lang.String fileName,
boolean append,
java.lang.String data)
Writes a string to a specified file, creating the file if it does not exist. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void write(java.lang.String fileName, boolean append, java.lang.String data) throws java.io.IOException
fileName
- The pathname string of the file to write to.append
- If true, the data will be added to the end of the file rather than overwriting the
file.data
- The content to write to the file.
java.io.IOException
FileUtils.writeStringToFile(File, String)
public static byte[] decode(java.lang.String data)
data
- The Base64 string to decode.
public static java.lang.String encode(byte[] data)
data
- The binary data to encode (byte array).
public static void write(java.lang.String fileName, boolean append, byte[] bytes) throws java.io.IOException
fileName
- The pathname string of the file to write to.append
- If true, the data will be added to the end of the file rather than overwriting the
file.bytes
- The binary content to write to the file.
java.io.IOException
FileUtils.writeByteArrayToFile(File, byte[])
public static byte[] readBytes(java.lang.String fileName) throws java.io.IOException
fileName
- The pathname string of the file to read from.
java.io.IOException
FileUtils.readFileToByteArray(File)
public static java.lang.String read(java.lang.String fileName) throws java.io.IOException
fileName
- The pathname string of the file to read from.
java.io.IOException
FileUtils.readFileToString(File)
public static boolean deleteFile(java.io.File file) throws java.lang.SecurityException
file
- The File to delete.
java.lang.SecurityException
public static java.lang.String rtfToPlainText(java.lang.String message, java.lang.String replaceLinebreaksWith) throws java.io.IOException, javax.swing.text.BadLocationException
message
- The RTF message to convert.replaceLinebreaksWith
- If not null, any line breaks in the converted message will be replaced with this
string.
java.io.IOException
javax.swing.text.BadLocationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |