Class GeoprocessingDataFile

java.lang.Object
com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingParameter
com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingDataFile
All Implemented Interfaces:
RemoteResource
Direct Known Subclasses:
GeoprocessingRaster

public class GeoprocessingDataFile extends GeoprocessingParameter implements RemoteResource
Corresponds to GPDataFile parameter type in the service REST specification.
Since:
100.0.0
  • Constructor Details

    • GeoprocessingDataFile

      public GeoprocessingDataFile()
      Creates an instance. The input url defaults to an empty string.
      Since:
      100.0.0
    • GeoprocessingDataFile

      public GeoprocessingDataFile(String inputUrl)
      Create a geoprocessing data parameter with the given URL.
      Parameters:
      inputUrl - the URL of the data file location
      Throws:
      NullPointerException - if inputUrl is null
      Since:
      100.0.0
  • Method Details

    • getUrl

      public String getUrl()
      Gets the URL of this parameter. This will be the location of the data file for an input parameter.

      This is only for input parameters to a URL containing the input data file. Ensure this URL is accessible to the service. A geoprocessing service can have an uploads rest resource associated with it for placing inputs.

      Note that if inputFilePath or uploadId are set the URL property will be ignored.

      Returns:
      the URL of this parameter
      Since:
      100.0.0
      See Also:
    • setUrl

      public void setUrl(String url)
      Sets the URL of this parameter. This will be the location of the data file for an input parameter.

      This is only for input parameters to a URL containing the input data file. Ensure this URL is accessible to the service. A geoprocessing service can have an uploads rest resource associated with it for placing inputs.

      Note that if inputFilePath or uploadId are set the URL property will be ignored.

      Parameters:
      url - the URL of this parameter
      Since:
      100.0.0
      See Also:
    • setUploadId

      public void setUploadId(String uploadId)
      Sets the upload item ID of this parameter. This should be the ID of an item in the geoprocessing service's uploads resource. This will be the upload ID of an item previously uploaded to the server. Note that if this property is set it will cause both the values of getInputFilePath() and getUrl() to be ignored.
      Parameters:
      uploadId - the upload ID
      Throws:
      IllegalArgumentException - if the upload ID is null or empty
      Since:
      100.1.0
    • getUploadId

      public String getUploadId()
      Gets the upload ID of this parameter. This will match the ID of an item in the geoprocessing service's uploads resource.
      Returns:
      the upload ID
      Since:
      100.1.0
    • setInputFilePath

      public void setInputFilePath(String inputFilePath)
      Sets the input file path of this parameter. This should be the location on disk of a file that will be uploaded to the server that the geoprocessing task will run on. Setting this will mean that the value of getUrl() will be ignored. Note that this property will be ignored if an upload ID is set.
      Parameters:
      inputFilePath - path to the input file
      Since:
      100.1.0
    • getInputFilePath

      public String getInputFilePath()
      Gets the input file path set on this data file parameter.
      Returns:
      the input file path
      Since:
      100.1.0
    • fetchFileAsync

      public ListenableFuture<Void> fetchFileAsync(String filePath)
      Asynchronously fetches the data file at the url indicated by getUrl().

      If filePath is a directory, the file will be given the name of the file taken from the end of the GeoprocessingDataFile.getUrl(). Alternatively filePath can be a destination filename within an existing directory. Note that any pre-existing file at that location with the same name will be deleted first.

      Parameters:
      filePath - path to a directory or full file name
      Throws:
      IllegalArgumentException - if filePath is null
      IllegalArgumentException - if filePath is empty
      Since:
      100.0.0
    • getCredential

      public Credential getCredential()
      Gets the credential used to authenticate the user with the geoprocessing service.
      Specified by:
      getCredential in interface RemoteResource
      Returns:
      the credential used for authentication
      Since:
      100.0.0
    • setCredential

      public void setCredential(Credential credential)
      Sets the credential used to authenticate the user with the geoprocessing service.
      Specified by:
      setCredential in interface RemoteResource
      Parameters:
      credential - the credential used for authentication
      Since:
      100.0.0
    • getRequestConfiguration

      public RequestConfiguration getRequestConfiguration()
      Gets the RequestConfiguration object that contains parameters used when making a request by this parameter - See fetchFileAsync(String).
      Specified by:
      getRequestConfiguration in interface RemoteResource
      Returns:
      the RequestConfiguration object or default values if nothing was set
      Since:
      100.0.0
      See Also:
    • setRequestConfiguration

      public void setRequestConfiguration(RequestConfiguration requestConfiguration)
      Sets the configuration parameters used for sending a network request using this parameter object - See fetchFileAsync(String). The global RequestConfiguration is used if no RequestConfiguration is set which contains the default values from the getter/setter methods.
      Specified by:
      setRequestConfiguration in interface RemoteResource
      Parameters:
      requestConfiguration - contains the parameters to use
      Since:
      100.0.0
      See Also: