|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.File | +--ie.tomallen.utils.FileHandler
Implements a FileHandler object, to read and write files. Dependencies: java.io.File, java.io.RandomAccessFile, java.io.FileReader
Field Summary | |
java.lang.String |
filename
filename of file handled by this object. |
long |
length
number of bytes in file. |
Fields inherited from class java.io.File |
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
FileHandler(java.io.File filep)
Constructor. |
|
FileHandler(java.lang.String filename)
Constructor. |
Method Summary | |
boolean |
isValid()
read. |
java.lang.String |
read(long offset,
long length)
read. |
java.lang.String |
readFile()
readFile, reads a entire file and returns a string. |
int |
write(java.lang.String str,
boolean append)
write. |
Methods inherited from class java.io.File |
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public long length
public java.lang.String filename
Constructor Detail |
public FileHandler(java.lang.String filename) throws TException
filename
- String name of filename
TException,
- whether an file is found to be a directory or does not exist.
TException
public FileHandler(java.io.File filep) throws TException
TException,
- whether an file is found to be a directory or does not exist.
TException
Method Detail |
public boolean isValid()
public java.lang.String readFile() throws TException
TException
public java.lang.String read(long offset, long length) throws TException
offset
- int
TException
public int write(java.lang.String str, boolean append) throws TException
str
- The string to write to fileappend
- boolean if..
TException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |