Class HTTPFileArg
-
- All Implemented Interfaces:
-
java.io.Serializable
,java.lang.Cloneable
,org.apache.jmeter.gui.Searchable
,org.apache.jmeter.testelement.TestElement
public class HTTPFileArg extends AbstractTestElement implements Serializable
Class representing a file parameter for http upload. Consists of a http parameter name/file path pair with (optional) mimetype. Also provides temporary storage for the headers which are sent with files.
-
-
Field Summary
Fields Modifier and Type Field Description public String
header
public transient JMeterContext
threadContext
public transient String
threadName
public final static TestElement.Companion
Companion
public final static String
NAME
public final static String
GUI_CLASS
public final static String
ENABLED
public final static String
TEST_CLASS
public final static String
COMMENTS
-
Constructor Summary
Constructors Constructor Description HTTPFileArg()
Constructor for an empty HTTPFileArg object HTTPFileArg(String path)
Constructor for the HTTPFileArg object with given path. HTTPFileArg(String path, String paramname, String mimetype)
Constructor for the HTTPFileArg object with full information. HTTPFileArg(JMeterProperty path, JMeterProperty paramname, JMeterProperty mimetype)
Constructor for the HTTPFileArg object with full information, using existing properties HTTPFileArg(HTTPFileArg file)
Copy Constructor.
-
Method Summary
Modifier and Type Method Description String
getHeader()
Gets the saved body header for the HTTPFileArg object. void
setHeader(String newHeader)
Sets the body header for the HTTPFileArg object. HTTPFileArgSchema
getSchema()
PropertiesAccessor<out HTTPFileArg, out HTTPFileArgSchema>
getProps()
void
setParamName(String newParamName)
Set the http parameter name of the File. String
getParamName()
Get the http parameter name of the File. void
setMimeType(String newMimeType)
Set the mimetype of the File. String
getMimeType()
Get the mimetype of the File. void
setPath(String newPath)
Set the path of the File. String
getPath()
Get the path of the File. String
toString()
returns path, param name, mime type information of HTTPFileArg object. boolean
isNotEmpty()
Check if the entry is not empty. -
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getString, removed, set
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
HTTPFileArg
HTTPFileArg()
Constructor for an empty HTTPFileArg object
-
HTTPFileArg
HTTPFileArg(String path)
Constructor for the HTTPFileArg object with given path.- Parameters:
path
- path to the file to use
-
HTTPFileArg
HTTPFileArg(String path, String paramname, String mimetype)
Constructor for the HTTPFileArg object with full information.- Parameters:
path
- path of the file to useparamname
- name of the http parameter to use for the filemimetype
- mimetype of the file
-
HTTPFileArg
HTTPFileArg(JMeterProperty path, JMeterProperty paramname, JMeterProperty mimetype)
Constructor for the HTTPFileArg object with full information, using existing properties- Parameters:
path
- path of the file to useparamname
- name of the http parameter to use for the filemimetype
- mimetype of the file
-
HTTPFileArg
HTTPFileArg(HTTPFileArg file)
Copy Constructor.- Parameters:
file
- HTTPFileArg to get information about the path, http parameter name and mimetype of the file
-
-
Method Detail
-
setHeader
void setHeader(String newHeader)
Sets the body header for the HTTPFileArg object. Header contains path, parameter name and mime type information. This is only intended for use by methods which need to store information temporarily whilst creating the HTTP body.
- Parameters:
newHeader
- the new Header value
-
getSchema
HTTPFileArgSchema getSchema()
-
getProps
PropertiesAccessor<out HTTPFileArg, out HTTPFileArgSchema> getProps()
-
setParamName
void setParamName(String newParamName)
Set the http parameter name of the File.
- Parameters:
newParamName
- the new http parameter name
-
getParamName
String getParamName()
Get the http parameter name of the File.
-
setMimeType
void setMimeType(String newMimeType)
Set the mimetype of the File.
- Parameters:
newMimeType
- the new mimetype
-
getMimeType
String getMimeType()
Get the mimetype of the File.
-
isNotEmpty
boolean isNotEmpty()
Check if the entry is not empty.
-
-
-
-