|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jaulp.file.read.ReadFileUtils
public class ReadFileUtils
The Class ReadFileUtils helps you reading files.
Constructor Summary | |
---|---|
ReadFileUtils()
|
Method Summary | |
---|---|
static byte[] |
getFilecontentAsByteArray(java.io.File tmpFile)
Get a byte array from the given file. |
static java.io.InputStream |
getInputStream(java.io.File file)
Gets the input stream from a File object. |
static java.io.InputStream |
getInputStream(java.io.File file,
boolean createFile)
Gets the input stream from a File object. |
static java.io.Reader |
getReader(java.io.File inputFile)
Gets a Reader from the given file object. |
static java.io.Reader |
getReader(java.io.File inputFile,
java.lang.String encoding,
boolean createFile)
Gets a Reader from the given file object. |
static java.lang.String |
inputStream2String(java.io.InputStream inputStream)
The Method inputStream2String() reads the data from the InputStream into a String. |
static java.io.Reader |
openFileReader(java.lang.String fileName)
The Method openFileReader() opens a BufferedReader from the given file. |
static java.lang.String |
reader2String(java.io.Reader reader)
The Method reader2String() reads the data from the Reader into a String. |
static byte[] |
readFileToBytearray(java.io.File file)
Get a byte array from the given file. |
static java.lang.String |
readFromFile(java.io.File file)
The Method readFromFile() reads the filecontent to a String. |
static java.lang.String |
readHeadLine(java.lang.String inputFile)
The Method readHeadLine() opens the File and reads the first line from the file. |
static java.util.List<java.lang.String> |
readLinesInList(java.io.File input)
Reads every line from the File and puts them to the List. |
static java.util.Properties |
readPropertiesFromFile(java.lang.String filename)
The Method readFromFile(String) reads from the properties-file all Properties and saves them into a Properties-Object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReadFileUtils()
Method Detail |
---|
public static byte[] getFilecontentAsByteArray(java.io.File tmpFile)
tmpFile
- The file.
public static java.io.InputStream getInputStream(java.io.File file) throws java.io.IOException
file
- the file.
java.io.IOException
- Signals that an I/O exception has occurred.public static java.io.InputStream getInputStream(java.io.File file, boolean createFile) throws java.io.IOException
file
- the filecreateFile
- If true and the file does not exist it will be create a new
file.
FileDoesNotExistException
- the file does not exist exception
java.io.IOException
- Signals that an I/O exception has occurred.public static java.io.Reader getReader(java.io.File inputFile) throws java.io.IOException
inputFile
- the input file.
java.io.IOException
- Signals that an I/O exception has occurred.public static java.io.Reader getReader(java.io.File inputFile, java.lang.String encoding, boolean createFile) throws java.io.IOException
inputFile
- the input fileencoding
- The encoding from the file.createFile
- If true and the file does not exist it will be create a new
file.
java.io.IOException
- Signals that an I/O exception has occurred.public static java.lang.String inputStream2String(java.io.InputStream inputStream)
inputStream
- The InputStream from where we read.
public static java.io.Reader openFileReader(java.lang.String fileName) throws java.io.IOException
fileName
- The file from where to read.
java.io.IOException
- Signals that an I/O exception has occurred.public static java.lang.String reader2String(java.io.Reader reader)
reader
- The Reader from where we read.
public static byte[] readFileToBytearray(java.io.File file)
file
- The file.
public static java.lang.String readFromFile(java.io.File file)
file
- The File to read to a String.
public static java.lang.String readHeadLine(java.lang.String inputFile)
inputFile
- The Path to the File and name from the file from where we
read.
public static java.util.List<java.lang.String> readLinesInList(java.io.File input) throws java.io.IOException
input
- The File from where the input comes.
java.io.IOException
- When a io-problem occurs.public static java.util.Properties readPropertiesFromFile(java.lang.String filename)
filename
- The Filename from the Properties-file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |