Package globus.glmap

Class NetworkTask


public class NetworkTask extends GLNativeObject
Network task that works via curl.
  • Constructor Details

    • NetworkTask

      public NetworkTask(@NonNull String url)
      Default constructor
      Parameters:
      url - url of task
  • Method Details

    • setHeader

      public void setHeader(@NonNull String key, @NonNull String value)
      Set header of task
      Parameters:
      key - key of header
      value - value of header
    • setMethod

      public void setMethod(@Nullable String method)
      Set methods
      Parameters:
      method - http method
    • setPostData

      public void setPostData(@NonNull byte[] data)
      Set post data
      Parameters:
      data - data
    • setFormFile

      public void setFormFile(@NonNull String fileName, @NonNull byte[] data)
      Changes request to form file post
      Parameters:
      fileName - file name
      data - data of file
    • start

      public void start(@NonNull NetworkTask.Callback callback)
      Starts task
      Parameters:
      callback - callback
    • cancel

      public void cancel()
      Cancels task