org.apache.jmeter.protocol.ftp.sampler

## Class FTPSampler

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.samplers.AbstractSampler
    - - org.apache.jmeter.protocol.ftp.sampler.FTPSampler

- All Implemented Interfaces:
    Serializable, Cloneable, ConfigMergabilityIndicator, Searchable, Interruptible, Sampler, TestElement

      public class FTPSampler
      extends AbstractSampler
      implements Interruptible

  A sampler which understands FTP file requests.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `BINARY_MODE`
    `static String` | `INPUT_DATA`
    `static String` | `LOCAL_FILENAME`
    `static String` | `PORT`
    `static String` | `REMOTE_FILENAME`
    `static String` | `SAVE_RESPONSE`
    `static String` | `SERVER`
    `static String` | `UPLOAD_FILE`

    - ### Fields inherited from interface org.apache.jmeter.testelement.TestElement

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FTPSampler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `applies(ConfigTestElement configElement)` Does configElement apply to Sampler
    `String` | `getLabel()` Returns a formatted string label describing this sampler Example output: ftp://ftp.nowhere.com/pub/README.txt
    `String` | `getLocalFilename()`
    `String` | `getPassword()`
    `String` | `getPort()`
    `int` | `getPortAsInt()`
    `String` | `getRemoteFilename()`
    `String` | `getServer()`
    `String` | `getUsername()`
    `boolean` | `interrupt()` Interrupt the current operation if possible.
    `boolean` | `isBinaryMode()`
    `boolean` | `isSaveResponse()`
    `boolean` | `isUpload()`
    `SampleResult` | `sample(Entry e)` Obtains statistics about the given Entry, and packages the information into a SampleResult.
    `void` | `setPort(String newPort)`
    `void` | `setServer(String newServer)`

    - ### Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

      `addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.testelement.TestElement

      `addTestElement, canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse`

- - ### Field Detail

    - #### SERVER

          public static final String SERVER

      See Also:
        Constant Field Values

    - #### PORT

          public static final String PORT

      See Also:
        Constant Field Values

    - #### REMOTE_FILENAME

          public static final String REMOTE_FILENAME

      See Also:
        Constant Field Values

    - #### LOCAL_FILENAME

          public static final String LOCAL_FILENAME

      See Also:
        Constant Field Values

    - #### INPUT_DATA

          public static final String INPUT_DATA

      See Also:
        Constant Field Values

    - #### BINARY_MODE

          public static final String BINARY_MODE

      See Also:
        Constant Field Values

    - #### UPLOAD_FILE

          public static final String UPLOAD_FILE

      See Also:
        Constant Field Values

    - #### SAVE_RESPONSE

          public static final String SAVE_RESPONSE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FTPSampler

          public FTPSampler()

  - ### Method Detail

    - #### getUsername

          public String getUsername()

    - #### getPassword

          public String getPassword()

    - #### setServer

          public void setServer(String newServer)

    - #### getServer

          public String getServer()

    - #### setPort

          public void setPort(String newPort)

    - #### getPort

          public String getPort()

    - #### getPortAsInt

          public int getPortAsInt()

    - #### getRemoteFilename

          public String getRemoteFilename()

    - #### getLocalFilename

          public String getLocalFilename()

    - #### isBinaryMode

          public boolean isBinaryMode()

    - #### isSaveResponse

          public boolean isSaveResponse()

    - #### isUpload

          public boolean isUpload()

    - #### getLabel

          public String getLabel()

      Returns a formatted string label describing this sampler Example output: ftp://ftp.nowhere.com/pub/README.txt
      Returns:
        a formatted string label describing this sampler

    - #### sample

          public SampleResult sample(Entry e)

      Description copied from interface: `Sampler`
      Obtains statistics about the given Entry, and packages the information into a SampleResult.
      Specified by:
        `sample` in interface `Sampler`
      Parameters:
        `e` - the Entry (TODO seems to be unused)
      Returns:
        information about the sample

    - #### interrupt

          public boolean interrupt()

      Interrupt the current operation if possible.
      Specified by:
        `interrupt` in interface `Interruptible`
      Returns:
        `true` if there was an operation to interrupt.

    - #### applies

          public boolean applies(ConfigTestElement configElement)

      Description copied from class: `AbstractSampler`
      Does configElement apply to Sampler
      Specified by:
        `applies` in interface `ConfigMergabilityIndicator`
      Overrides:
        `applies` in class `AbstractSampler`
      Parameters:
        `configElement` - `ConfigTestElement`
      Returns:
        boolean
      See Also:
        `AbstractSampler.applies(org.apache.jmeter.config.ConfigTestElement)`

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