java.lang.Object
java.io.File
org.apache.jorphan.io.TextFile
- All Implemented Interfaces:
- java.lang.Comparable, java.io.Serializable
- public class TextFile
- extends java.io.File
Utility class to handle text files as a single lump of text.
Note this is just as memory-inefficient as handling a text file can be. Use
with restraint.
- Version:
- $Revision: 1.10 $ updated on $Date: 2005/07/12 20:51:08 $
| 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 |
log
private static transient Logger log
encoding
private java.lang.String encoding
- File encoding. null means use the platform's default.
TextFile
public TextFile(java.io.File filename,
java.lang.String encoding)
- Create a TextFile object to handle the named file with the given
encoding.
TextFile
public TextFile(java.io.File filename)
- Create a TextFile object to handle the named file with the platform
default encoding.
TextFile
public TextFile(java.lang.String filename)
- Create a TextFile object to handle the named file with the platform
default encoding.
TextFile
public TextFile(java.lang.String filename,
java.lang.String encoding)
- Create a TextFile object to handle the named file with the given
encoding.
setText
public void setText(java.lang.String body)
- Create the file with the given string as content -- or replace it's
content with the given string if the file already existed.
getText
public java.lang.String getText()
- Read the whole file content and return it as a string.
getEncoding
public java.lang.String getEncoding()
setEncoding
public void setEncoding(java.lang.String string)