Apache JMeter
2.1.1

org.apache.jmeter.services
Class FileServer

java.lang.Object
  extended byorg.apache.jmeter.services.FileServer

public class FileServer
extends Object

Author:
mstover 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(String name)
           
 void closeFiles()
           
protected  boolean filesOpen()
           
 String getBaseDir()
           
static FileServer getFileServer()
           
 File getRandomFile(String basedir, String[] extensions)
          Method will get a random file in a base directory TODO hey, not sure this method belongs here.
 String readLine(String filename)
          Get the next line of the named file.
 void reserveFile(String filename)
           
 void setBasedir(String basedir)
           
 void write(String filename, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileServer

public static FileServer getFileServer()

setBasedir

public void setBasedir(String basedir)
                throws IOException
Throws:
IOException

getBaseDir

public String getBaseDir()

reserveFile

public void reserveFile(String filename)

readLine

public String readLine(String filename)
                throws IOException
Get the next line of the named file.

Parameters:
filename -
Returns:
Throws:
IOException

write

public void write(String filename,
                  String value)
           throws IOException
Throws:
IOException

closeFiles

public void closeFiles()
                throws IOException
Throws:
IOException

closeFile

public void closeFile(String name)
               throws IOException
Parameters:
name -
Throws:
IOException

filesOpen

protected boolean filesOpen()

getRandomFile

public File getRandomFile(String basedir,
                          String[] extensions)
Method will get a random file in a base directory TODO hey, not sure this method belongs here. FileServer is for threadsafe File access relative to current test's base directory.

Parameters:
basedir -
Returns:

Apache JMeter
2.1.1

Copyright © 1998-2005 Apache Software Foundation. All Rights Reserved.