|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.File org.apache.jorphan.io.TextFile
public class TextFile
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.
Field Summary |
---|
Fields inherited from class java.io.File |
---|
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
---|---|
TextFile(File filename)
Create a TextFile object to handle the named file with the platform default encoding. |
|
TextFile(File filename,
String encoding)
Create a TextFile object to handle the named file with the given encoding. |
|
TextFile(String filename)
Create a TextFile object to handle the named file with the platform default encoding. |
|
TextFile(String filename,
String encoding)
Create a TextFile object to handle the named file with the given encoding. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getEncoding()
|
String |
getText()
Read the whole file content and return it as a string. |
int |
hashCode()
|
void |
setEncoding(String string)
|
void |
setText(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. |
Methods inherited from class java.io.File |
---|
canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, 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 |
Constructor Detail |
---|
public TextFile(File filename, String encoding)
filename
- File to be read & written through this object.encoding
- Encoding to be used when reading & writing this file.public TextFile(File filename)
filename
- File to be read & written through this object.public TextFile(String filename)
filename
- Name of the file to be read & written through this object.public TextFile(String filename, String encoding)
filename
- Name of the file to be read & written through this object.encoding
- Encoding to be used when reading & writing this file.Method Detail |
---|
public void setText(String body)
body
- New content for the file.public String getText()
public String getEncoding()
public void setEncoding(String string)
string
- Encoding to be used to read & write this file.public int hashCode()
hashCode
in class File
public boolean equals(Object obj)
equals
in class File
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |