Package com.ads.services.webservice

# Class FileService

java.lang.Object
com.ads.services.webservice.FileService

public class FileService extends Object
Contains the methods which performs the operations related to files.
All the WebServices methods have return type String - meaning if the method is execution is successful, then it will return a string in the form of JSON or XML String based on the outputFormat parameter given by the user.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FileService()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `jakarta.activation.DataHandler`
  `downloadFile(String userName, String password, String fileLocation)`
  Downloads the file from given file location from the server, Specifying the fileLocation is mandatory, and the input file path should be relative path only.
  `String`
  `uploadFile(String userName, String password, String outputFormat, jakarta.activation.DataHandler attachment, String outputFileName)`
  Uploads the given file to the server and returns the relative path of uploaded file.The uploaded path will be available in userObject of RequestStatus object.

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FileService

    public FileService()

- ## Method Details

  - ### uploadFile

    public String uploadFile(String userName, String password, String outputFormat, jakarta.activation.DataHandler attachment, String outputFileName)
    Uploads the given file to the server and returns the relative path of uploaded file.The uploaded path will be available in userObject of RequestStatus object.
    The extension of the uploaded file and the extension in the outputFileName should be same.
    Parameters:
      `userName` - - String
      `password` - - String
      `outputFormat` - - String - Valid values: JSON or XML
      `attachment` - - DataHandler object
      `outputFileName` - - String - Name of the file that will be saved in the server.
    Returns:
      - String - If file is uploaded successfully, it will return RequestStatus Object consisting of Request success flag, status message and userObject etc... in the form of JSON or XML String.
    Since:
      10.1

  - ### downloadFile

    public jakarta.activation.DataHandler downloadFile(String userName, String password, String fileLocation)
    Downloads the file from given file location from the server, Specifying the fileLocation is mandatory, and the input file path should be relative path only.
    Parameters:
      `userName` - - String
      `password` - - String
      `fileLocation` - - String - Location of the file from the server.
    Returns:
      - DataHandler object
    Since:
      - 12.0