|
Terrier IR Platform 1.1.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.gla.terrier.utility.Files
public class Files
Utililty class for opening readers/writers and input/output streams to files. Handles gzipped files on the fly, ie if a file ends in ".gz" or ".GZ", then it will be opened using a GZipInputStream/GZipOutputStream. All returned Streams, Readers, Writers etc are Buffered. If a charset encoding is not specified, then the system default is used.
Constructor Summary | |
---|---|
Files()
|
Method Summary | |
---|---|
static java.lang.Long |
copyFile(java.io.File srcFile,
java.io.File destFile)
Copy a file from srcFile to destFile. |
static java.lang.Long |
copyFile(java.lang.String srcFilename,
java.lang.String destFilename)
Copy a file from srcFile to destFile. |
static java.lang.Long |
createChecksum(java.io.File file)
Returns the CRC checksum of denoted file |
static java.io.BufferedReader |
openFileReader(java.io.File file)
Opens a reader to the file called file. |
static java.io.BufferedReader |
openFileReader(java.io.File file,
java.lang.String charset)
Opens a reader to the file called filename. |
static java.io.BufferedReader |
openFileReader(java.lang.String filename)
Opens a reader to the file called filename. |
static java.io.BufferedReader |
openFileReader(java.lang.String filename,
java.lang.String charset)
Opens a reader to the file called filename. |
static java.io.InputStream |
openFileStream(java.io.File file)
Opens an InputStream to a file called file. |
static java.io.InputStream |
openFileStream(java.lang.String filename)
Opens an InputStream to a file called filename. |
static java.io.OutputStream |
writeFileStream(java.io.File file)
Opens an OutputStream to a file called file. |
static java.io.OutputStream |
writeFileStream(java.lang.String filename)
Opens an OutputStream to a file called filename. |
static java.io.Writer |
writeFileWriter(java.io.File file)
Opens an Writer to a file called file. |
static java.io.Writer |
writeFileWriter(java.io.File file,
java.lang.String charset)
Opens an Writer to a file called file. |
static java.io.Writer |
writeFileWriter(java.lang.String filename)
Opens an Writer to a file called file. |
static java.io.Writer |
writeFileWriter(java.lang.String filename,
java.lang.String charset)
Opens an Writer to a file called file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Files()
Method Detail |
---|
public static java.io.BufferedReader openFileReader(java.io.File file) throws java.io.IOException
file
- File to open.
java.io.IOException
public static java.io.BufferedReader openFileReader(java.io.File file, java.lang.String charset) throws java.io.IOException
file
- File to open.charset
- Character set encoding of file. null for system default.
java.io.IOException
public static java.io.BufferedReader openFileReader(java.lang.String filename) throws java.io.IOException
filename
- File to open.
java.io.IOException
public static java.io.BufferedReader openFileReader(java.lang.String filename, java.lang.String charset) throws java.io.IOException
filename
- File to open.charset
- Character set encoding of file. null for system default.
java.io.IOException
public static java.io.InputStream openFileStream(java.io.File file) throws java.io.IOException
file
- File to open.
java.io.IOException
public static java.io.InputStream openFileStream(java.lang.String filename) throws java.io.IOException
filename
- File to open.
java.io.IOException
public static java.io.OutputStream writeFileStream(java.io.File file) throws java.io.IOException
file
- File to open.
java.io.IOException
public static java.io.OutputStream writeFileStream(java.lang.String filename) throws java.io.IOException
filename
- File to open.
java.io.IOException
public static java.io.Writer writeFileWriter(java.io.File file) throws java.io.IOException
file
- File to open.
java.io.IOException
public static java.io.Writer writeFileWriter(java.io.File file, java.lang.String charset) throws java.io.IOException
file
- File to open.charset
- Character set encoding of file. null for system default.
java.io.IOException
public static java.io.Writer writeFileWriter(java.lang.String filename) throws java.io.IOException
filename
- File to open.
java.io.IOException
public static java.io.Writer writeFileWriter(java.lang.String filename, java.lang.String charset) throws java.io.IOException
filename
- File to open.charset
- Character set encoding of file. null for system default.
java.io.IOException
public static java.lang.Long copyFile(java.lang.String srcFilename, java.lang.String destFilename) throws java.io.IOException
java.io.IOException
- if there was a problem copyingpublic static java.lang.Long copyFile(java.io.File srcFile, java.io.File destFile) throws java.io.IOException
java.io.IOException
- if there was a problem copyingpublic static java.lang.Long createChecksum(java.io.File file) throws java.io.IOException
java.io.IOException
|
Terrier IR Platform 1.1.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |