blob: 2963f66baff645a75884c1b3dc337b0985d55f62 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FileServer (Apache JMeter dist API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FileServer (Apache JMeter dist API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":9,"i5":9,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":9,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache JMeter</b></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/jmeter/services/FileServer.html" target="_top">Frames</a></li>
<li><a href="FileServer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.jmeter.services</div>
<h2 title="Class FileServer" class="title">Class FileServer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.jmeter.services.FileServer</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">FileServer</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">This class provides 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.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#closeFile-java.lang.String-">closeFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#closeFiles--">closeFiles</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getBaseDir--">getBaseDir</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getBaseDirRelative--">getBaseDirRelative</a></span>()</code>
<div class="block">Calculates the relative path from DEFAULT_BASE to the current base,
which must be the same as or a child of the default.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getDefaultBase--">getDefaultBase</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/jmeter/services/FileServer.html" title="class in org.apache.jmeter.services">FileServer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getFileServer--">getFileServer</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getParsedLine-java.lang.String-boolean-boolean-char-">getParsedLine</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias,
boolean&nbsp;recycle,
boolean&nbsp;ignoreFirstLine,
char&nbsp;delim)</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getRandomFile-java.lang.String-java.lang.String:A-">getRandomFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;basedir,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;extensions)</code>
<div class="block">Method will get a random file in a base directory</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getResolvedFile-java.lang.String-">getResolvedFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;path)</code>
<div class="block">Get <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a> instance for provided file path,
resolve file location relative to base dir or script dir when needed</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#getScriptName--">getScriptName</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#readLine-java.lang.String-">readLine</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
<div class="block">Get the next line of the named file, recycle by default.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#readLine-java.lang.String-boolean-">readLine</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
boolean&nbsp;recycle)</code>
<div class="block">Get the next line of the named file, first line is name to false</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#readLine-java.lang.String-boolean-boolean-">readLine</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
boolean&nbsp;recycle,
boolean&nbsp;ignoreFirstLine)</code>
<div class="block">Get the next line of the named file</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#reserveFile-java.lang.String-">reserveFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#reserveFile-java.lang.String-java.lang.String-">reserveFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</code>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#reserveFile-java.lang.String-java.lang.String-java.lang.String-">reserveFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias)</code>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#reserveFile-java.lang.String-java.lang.String-java.lang.String-boolean-">reserveFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias,
boolean&nbsp;hasHeader)</code>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#resetBase--">resetBase</a></span>()</code>
<div class="block">Resets the current base to DEFAULT_BASE.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#resolveBaseRelativeName-java.lang.String-">resolveBaseRelativeName</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;relativeName)</code>
<div class="block">Resolve a file name that may be relative to the base directory.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#setBase-java.io.File-">setBase</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;jmxBase)</code>
<div class="block">Sets the current base directory for relative file names.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#setBasedir-java.lang.String-">setBasedir</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;basedir)</code>
<div class="block">Sets the current base directory for relative file names from the provided path.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#setBaseForScript-java.io.File-">setBaseForScript</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;scriptPath)</code>
<div class="block">Sets the current base directory for relative file names from the provided script file.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#setScriptName-java.lang.String-">setScriptName</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;scriptName)</code>&nbsp;</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/jmeter/services/FileServer.html#write-java.lang.String-java.lang.String-">write</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getFileServer--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileServer</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/jmeter/services/FileServer.html" title="class in org.apache.jmeter.services">FileServer</a>&nbsp;getFileServer()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the singleton instance of the server.</dd>
</dl>
</li>
</ul>
<a name="resetBase--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resetBase</h4>
<pre>public&nbsp;void&nbsp;resetBase()</pre>
<div class="block">Resets the current base to DEFAULT_BASE.</div>
</li>
</ul>
<a name="setBasedir-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBasedir</h4>
<pre>public&nbsp;void&nbsp;setBasedir(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;basedir)</pre>
<div class="block">Sets the current base directory for relative file names from the provided path.
If the path does not refer to an existing directory, then its parent is used.
Normally the provided path is a file, so using the parent directory is appropriate.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>basedir</code> - the path to set, or <code>null</code> if the GUI is being cleared</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if files are still open</dd>
</dl>
</li>
</ul>
<a name="setBaseForScript-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBaseForScript</h4>
<pre>public&nbsp;void&nbsp;setBaseForScript(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;scriptPath)</pre>
<div class="block">Sets the current base directory for relative file names from the provided script file.
The parameter is assumed to be the path to a JMX file, so the base directory is derived
from its parent.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>scriptPath</code> - the path of the script file; must be not be <code>null</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if files are still open</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if scriptPath parameter is null</dd>
</dl>
</li>
</ul>
<a name="setBase-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBase</h4>
<pre>public&nbsp;void&nbsp;setBase(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;jmxBase)</pre>
<div class="block">Sets the current base directory for relative file names.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jmxBase</code> - the path of the script file base directory, cannot be null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if files are still open</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>basepath</code> is null</dd>
</dl>
</li>
</ul>
<a name="getBaseDir--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBaseDir</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getBaseDir()</pre>
</li>
</ul>
<a name="getDefaultBase--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultBase</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getDefaultBase()</pre>
</li>
</ul>
<a name="getBaseDirRelative--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBaseDirRelative</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;getBaseDirRelative()</pre>
<div class="block">Calculates the relative path from DEFAULT_BASE to the current base,
which must be the same as or a child of the default.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the relative path, or <code>"."</code> if the path cannot be determined</dd>
</dl>
</li>
</ul>
<a name="reserveFile-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reserveFile</h4>
<pre>public&nbsp;void&nbsp;reserveFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</pre>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - - relative (to base) or absolute file name (must not be null)</dd>
</dl>
</li>
</ul>
<a name="reserveFile-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reserveFile</h4>
<pre>public&nbsp;void&nbsp;reserveFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</pre>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - - relative (to base) or absolute file name (must not be null)</dd>
<dd><code>charsetName</code> - - the character set encoding to use for the file (may be null)</dd>
</dl>
</li>
</ul>
<a name="reserveFile-java.lang.String-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reserveFile</h4>
<pre>public&nbsp;void&nbsp;reserveFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias)</pre>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - - relative (to base) or absolute file name (must not be null)</dd>
<dd><code>charsetName</code> - - the character set encoding to use for the file (may be null)</dd>
<dd><code>alias</code> - - the name to be used to access the object (must not be null)</dd>
</dl>
</li>
</ul>
<a name="reserveFile-java.lang.String-java.lang.String-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reserveFile</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;reserveFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias,
boolean&nbsp;hasHeader)</pre>
<div class="block">Creates an association between a filename and a File inputOutputObject,
and stores it for later use - unless it is already stored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - - relative (to base) or absolute file name (must not be null or empty)</dd>
<dd><code>charsetName</code> - - the character set encoding to use for the file (may be null)</dd>
<dd><code>alias</code> - - the name to be used to access the object (must not be null)</dd>
<dd><code>hasHeader</code> - true if the file has a header line describing the contents</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the header line; may be null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if header could not be read or filename is null or empty</dd>
</dl>
</li>
</ul>
<a name="readLine-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readLine</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;readLine(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Get the next line of the named file, recycle by default.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - the filename or alias that was used to reserve the file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>String containing the next line in the file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - when reading of the file fails, or the file was not reserved properly</dd>
</dl>
</li>
</ul>
<a name="readLine-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readLine</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;readLine(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
boolean&nbsp;recycle)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Get the next line of the named file, first line is name to false</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - the filename or alias that was used to reserve the file</dd>
<dd><code>recycle</code> - - should file be restarted at EOF?</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>String containing the next line in the file (null if EOF reached and not recycle)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - when reading of the file fails, or the file was not reserved properly</dd>
</dl>
</li>
</ul>
<a name="readLine-java.lang.String-boolean-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readLine</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;readLine(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
boolean&nbsp;recycle,
boolean&nbsp;ignoreFirstLine)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Get the next line of the named file</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - the filename or alias that was used to reserve the file</dd>
<dd><code>recycle</code> - - should file be restarted at EOF?</dd>
<dd><code>ignoreFirstLine</code> - - Ignore first line</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>String containing the next line in the file (null if EOF reached and not recycle)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - when reading of the file fails, or the file was not reserved properly</dd>
</dl>
</li>
</ul>
<a name="getParsedLine-java.lang.String-boolean-boolean-char-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParsedLine</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;getParsedLine(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;alias,
boolean&nbsp;recycle,
boolean&nbsp;ignoreFirstLine,
char&nbsp;delim)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>alias</code> - the file name or alias</dd>
<dd><code>recycle</code> - whether the file should be re-started on EOF</dd>
<dd><code>ignoreFirstLine</code> - whether the file contains a file header which will be ignored</dd>
<dd><code>delim</code> - the delimiter to use for parsing</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the parsed line, will be empty if the file is at EOF</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - when reading of the aliased file fails, or the file was not reserved properly</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public&nbsp;void&nbsp;write(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="closeFiles--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>closeFiles</h4>
<pre>public&nbsp;void&nbsp;closeFiles()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="closeFile-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>closeFile</h4>
<pre>public&nbsp;void&nbsp;closeFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name or alias of the file to be closed</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - when closing of the aliased file fails</dd>
</dl>
</li>
</ul>
<a name="getRandomFile-java.lang.String-java.lang.String:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRandomFile</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;getRandomFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;basedir,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;extensions)</pre>
<div class="block">Method will get a random file in a base directory
<p>
TODO hey, not sure this method belongs here.
FileServer is for thread safe File access relative to current test's base directory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>basedir</code> - name of the directory in which the files can be found</dd>
<dd><code>extensions</code> - array of allowed extensions, if <code>null</code> is given,
any file be allowed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a random File from the <code>basedir</code> that matches one of
the extensions</dd>
</dl>
</li>
</ul>
<a name="getResolvedFile-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResolvedFile</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;getResolvedFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;path)</pre>
<div class="block">Get <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a> instance for provided file path,
resolve file location relative to base dir or script dir when needed</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - original path to file, maybe relative</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a> instance</dd>
</dl>
</li>
</ul>
<a name="resolveBaseRelativeName-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolveBaseRelativeName</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;resolveBaseRelativeName(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;relativeName)</pre>
<div class="block">Resolve a file name that may be relative to the base directory. If the
name begins with the value of the JMeter property
"jmeter.save.saveservice.base_prefix" - default "~/" - then the name is
assumed to be relative to the basename.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>relativeName</code> - filename that should be checked for
<code>jmeter.save.saveservice.base_prefix</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the updated filename</dd>
</dl>
</li>
</ul>
<a name="getScriptName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getScriptName</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getScriptName()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>JMX Script name</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.6</dd>
</dl>
</li>
</ul>
<a name="setScriptName-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setScriptName</h4>
<pre>public&nbsp;void&nbsp;setScriptName(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;scriptName)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>scriptName</code> - Script name</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.6</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache JMeter</b></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/jmeter/services/FileServer.html" target="_top">Frames</a></li>
<li><a href="FileServer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.</small></p>
</body>
</html>