|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infoglue.cms.io.FileHelper
public class FileHelper
| Constructor Summary | |
|---|---|
FileHelper()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getFileAsString(java.io.File file)
This method reads a file from the disk into a string. |
static byte[] |
getFileBytes(java.io.File file)
This method reads a file from the disk and converts it to an byte[]. |
static java.lang.String |
getStreamAsString(java.io.InputStream inputStream)
This method reads a file from the disk into a string. |
static java.lang.String |
readUTF8FromFile(java.io.File file)
Writes the file to the hard disk. |
static java.lang.String |
tail(java.io.File file,
int numberOfLines)
Reading the x last lines of a file |
static void |
writeToFile(java.io.File file,
byte[] data)
This method writes a file with data from a byte[]. |
static void |
writeToFile(java.io.File file,
java.lang.String text,
boolean isAppend)
Writes the file to the hard disk. |
static void |
writeUTF8(java.io.File file,
java.lang.String text,
boolean isAppend)
|
static void |
writeUTF8ToFile(java.io.File file,
java.lang.String text,
boolean isAppend)
|
static void |
writeUTF8ToFileSpecial(java.io.File file,
java.lang.String text,
boolean isAppend)
Writes the file to the hard disk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileHelper()
| Method Detail |
|---|
public static void writeToFile(java.io.File file,
java.lang.String text,
boolean isAppend)
throws java.lang.Exception
text - The text you want to write to the file.file - The file to save tois_append - Dictates if the text should be appended to the existing file.
If is_append == true; The text will be added to the existing file.
If is_append == false; The text will overwrite the existing contents of the file.
java.lang.Exception
public static void writeUTF8ToFileSpecial(java.io.File file,
java.lang.String text,
boolean isAppend)
throws java.lang.Exception
text - The text you want to write to the file.file - The file to save tois_append - Dictates if the text should be appended to the existing file.
If is_append == true; The text will be added to the existing file.
If is_append == false; The text will overwrite the existing contents of the file.
java.lang.Exception
public static void writeUTF8(java.io.File file,
java.lang.String text,
boolean isAppend)
throws java.lang.Exception
java.lang.Exception
public static void writeUTF8ToFile(java.io.File file,
java.lang.String text,
boolean isAppend)
throws java.lang.Exception
java.lang.Exception
public static java.lang.String readUTF8FromFile(java.io.File file)
throws java.lang.Exception
text - The text you want to write to the file.file - The file to save tois_append - Dictates if the text should be appended to the existing file.
If is_append == true; The text will be added to the existing file.
If is_append == false; The text will overwrite the existing contents of the file.
java.lang.Exception
public static byte[] getFileBytes(java.io.File file)
throws java.lang.Exception
file - The file read bytes from
java.lang.Exception
public static java.lang.String getFileAsString(java.io.File file)
throws java.lang.Exception
file - The file reads from
java.lang.Exception
public static java.lang.String getStreamAsString(java.io.InputStream inputStream)
throws java.lang.Exception
file - The file reads from
java.lang.Exception
public static void writeToFile(java.io.File file,
byte[] data)
throws java.lang.Exception
file - The file to save to
java.lang.Exception
public static java.lang.String tail(java.io.File file,
int numberOfLines)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||