Package com.ads.services.webservice
Class FileService
java.lang.Object
com.ads.services.webservice.FileService
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.
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 -
Method Summary
Modifier and TypeMethodDescriptionjakarta.activation.DataHandlerdownloadFile(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.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.
-
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- - Stringpassword- - StringoutputFormat- - String - Valid values: JSON or XMLattachment- - DataHandler objectoutputFileName- - 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- - Stringpassword- - StringfileLocation- - String - Location of the file from the server.- Returns:
- - DataHandler object
- Since:
- - 12.0
-