|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.services.FileServer
public class FileServer
The point of this class is to provide thread-safe access to files, and to provide some simplifying assumptions about where to find files and how to name them. For instance, putting supporting files in the same directory as the saved test plan file allows users to refer to the file with just it's name - this FileServer class will find the file without a problem. Eventually, I want all in-test file access to be done through here, with the goal of packaging up entire test plans as a directory structure that can be sent via rmi to remote servers (currently, one must make sure the remote server has all support files in a relative-same location) and to package up test plans to execute on unknown boxes that only have Java installed.
Method Summary | |
---|---|
void |
closeFile(java.lang.String name)
|
void |
closeFiles()
|
protected boolean |
filesOpen()
|
java.lang.String |
getBaseDir()
|
static FileServer |
getFileServer()
|
java.io.File |
getRandomFile(java.lang.String basedir,
java.lang.String[] extensions)
Method will get a random file in a base directory TODO hey, not sure this method belongs here. |
java.lang.String |
readLine(java.lang.String filename)
Get the next line of the named file, recycle by default. |
java.lang.String |
readLine(java.lang.String filename,
boolean recycle)
Get the next line of the named file. |
void |
reserveFile(java.lang.String filename)
Creates an association between a filename and a File inputOutputObject, and stores it for later use - unless it is already stored. |
void |
reserveFile(java.lang.String filename,
java.lang.String charsetName)
Creates an association between a filename and a File inputOutputObject, and stores it for later use - unless it is already stored. |
void |
reserveFile(java.lang.String filename,
java.lang.String charsetName,
java.lang.String alias)
Creates an association between a filename and a File inputOutputObject, and stores it for later use - unless it is already stored. |
void |
resetBase()
|
void |
setBasedir(java.lang.String basedir)
|
void |
write(java.lang.String filename,
java.lang.String value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static FileServer getFileServer()
public void resetBase() throws java.io.IOException
java.io.IOException
public void setBasedir(java.lang.String basedir) throws java.io.IOException
java.io.IOException
public java.lang.String getBaseDir()
public void reserveFile(java.lang.String filename)
filename
- - relative (to base) or absolute file name (must not be null)public void reserveFile(java.lang.String filename, java.lang.String charsetName)
filename
- - relative (to base) or absolute file name (must not be null)charsetName
- - the character set encoding to use for the file (may be null)public void reserveFile(java.lang.String filename, java.lang.String charsetName, java.lang.String alias)
filename
- - relative (to base) or absolute file name (must not be null)charsetName
- - the character set encoding to use for the file (may be null)alias
- - the name to be used to access the object (must not be null)public java.lang.String readLine(java.lang.String filename) throws java.io.IOException
filename
-
java.io.IOException
public java.lang.String readLine(java.lang.String filename, boolean recycle) throws java.io.IOException
filename
- recycle
- - should file be restarted at EOF?
java.io.IOException
public void write(java.lang.String filename, java.lang.String value) throws java.io.IOException
java.io.IOException
public void closeFiles() throws java.io.IOException
java.io.IOException
public void closeFile(java.lang.String name) throws java.io.IOException
name
-
java.io.IOException
protected boolean filesOpen()
public java.io.File getRandomFile(java.lang.String basedir, java.lang.String[] extensions)
basedir
-
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |