org.apache.jmeter.protocol.http.util

## Class HTTPFileArgs

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.config.ConfigTestElement
    - - org.apache.jmeter.protocol.http.util.HTTPFileArgs

- All Implemented Interfaces:
    Serializable, Cloneable, ConfigElement, Searchable, TestElement

      public class HTTPFileArgs
      extends ConfigTestElement
      implements Serializable

  A set of HTTPFileArg objects.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.apache.jmeter.config.ConfigTestElement

      `PASSWORD, USERNAME`

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

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HTTPFileArgs()` Create a new HTTPFileArgs object with no files.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEmptyHTTPFileArg()` Add a new empty file to the list.
    `void` | `addHTTPFileArg(HTTPFileArg file)` Add a new file.
    `void` | `addHTTPFileArg(String path)` Add a new file with the given path.
    `void` | `addHTTPFileArg(String path, String param, String mime)` adds a new File to the HTTPFileArgs list to be uploaded with http request.
    `HTTPFileArg[]` | `asArray()` Get the current arguments as an array.
    `void` | `clear()` Clear the files.
    `HTTPFileArg` | `getHTTPFileArg(int row)` Get a single file.
    `int` | `getHTTPFileArgCount()` Get the number of files in the list.
    `CollectionProperty` | `getHTTPFileArgsCollection()` Get the files.
    `PropertyIterator` | `iterator()` Get a PropertyIterator of the files.
    `void` | `removeAllHTTPFileArgs()` Remove all files from the list.
    `void` | `removeHTTPFileArg(HTTPFileArg file)` Remove the specified file from the list.
    `void` | `removeHTTPFileArg(int row)` Remove the specified file from the list.
    `void` | `removeHTTPFileArg(String filePath)` Remove the file with the specified path.
    `void` | `setHTTPFileArgs(List<HTTPFileArg> files)` Set the list of files.
    `String` | `toString()` Create a string representation of the files.

    - ### Methods inherited from class org.apache.jmeter.config.ConfigTestElement

      `addConfigElement, addTestElement, expectsModification`

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

      `addPropertiesValues, addProperty, addProperty, canRemove, 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, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.config.ConfigElement

      `clone`

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

      `removed`

- - ### Constructor Detail

    - #### HTTPFileArgs

          public HTTPFileArgs()

      Create a new HTTPFileArgs object with no files.

  - ### Method Detail

    - #### getHTTPFileArgsCollection

          public CollectionProperty getHTTPFileArgsCollection()

      Get the files.
      Returns:
        the files

    - #### clear

          public void clear()

      Clear the files.
      Specified by:
        `clear` in interface `TestElement`
      Overrides:
        `clear` in class `AbstractTestElement`

    - #### setHTTPFileArgs

          public void setHTTPFileArgs(List<HTTPFileArg> files)

      Set the list of files. Any existing files will be lost.
      Parameters:
        `files` - the new files

    - #### addHTTPFileArg

          public void addHTTPFileArg(String path)

      Add a new file with the given path.
      Parameters:
        `path` - the path of the file

    - #### addHTTPFileArg

          public void addHTTPFileArg(HTTPFileArg file)

      Add a new file.
      Parameters:
        `file` - the new file

    - #### addHTTPFileArg

          public void addHTTPFileArg(String path,
                                     String param,
                                     String mime)

      adds a new File to the HTTPFileArgs list to be uploaded with http request.
      Parameters:
        `path` - file full path.
        `param` - http parameter name.
        `mime` - mime type of file.

    - #### iterator

          public PropertyIterator iterator()

      Get a PropertyIterator of the files.
      Returns:
        an iteration of the files

    - #### asArray

          public HTTPFileArg[] asArray()

      Get the current arguments as an array.
      Returns:
        an array of file arguments

    - #### toString

          public String toString()

      Create a string representation of the files.
      Overrides:
        `toString` in class `Object`
      Returns:
        the string representation of the files

    - #### removeHTTPFileArg

          public void removeHTTPFileArg(int row)

      Remove the specified file from the list.
      Parameters:
        `row` - the index of the file to remove

    - #### removeHTTPFileArg

          public void removeHTTPFileArg(HTTPFileArg file)

      Remove the specified file from the list.
      Parameters:
        `file` - the file to remove

    - #### removeHTTPFileArg

          public void removeHTTPFileArg(String filePath)

      Remove the file with the specified path.
      Parameters:
        `filePath` - the path of the file to remove

    - #### removeAllHTTPFileArgs

          public void removeAllHTTPFileArgs()

      Remove all files from the list.

    - #### addEmptyHTTPFileArg

          public void addEmptyHTTPFileArg()

      Add a new empty file to the list. The new file will have the empty string as its path.

    - #### getHTTPFileArgCount

          public int getHTTPFileArgCount()

      Get the number of files in the list.
      Returns:
        the number of files

    - #### getHTTPFileArg

          public HTTPFileArg getHTTPFileArg(int row)

      Get a single file.
      Parameters:
        `row` - the index of the file to return.
      Returns:
        the file at the specified index, or null if no file exists at that index.

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