public interface ClaritySFTPUploader
Interface for SFTP file store upload and delete implementations to adhere to. These
implementations allow the Clarity API Client to upload to and delete from
the Clarity file store on the server. Without an implementation present the client
will work but only through HTTP, which has limitations.
- Since:
- 2.31.0
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(ClarityFile targetFile) Delete a file from the Clarity file store.voidsetFilestoreCredentials(String username, String password) Set the credentials used to connect to the file store.voidsetTimeout(int timeout) Set how long an SSH connection will take to time out (in milliseconds).voidupload(URLInputStreamResource fileURLResource, ClarityFile targetFile) Upload a file to the Clarity file store.
-
Method Details
-
setTimeout
void setTimeout(int timeout) Set how long an SSH connection will take to time out (in milliseconds).- Parameters:
timeout- The time out, in milliseconds. Generally 0 means infinite.- Throws:
IllegalArgumentException- iftimeoutis negative.
-
setFilestoreCredentials
Set the credentials used to connect to the file store.- Parameters:
username- The file store user account.password- The file store user password.- Throws:
IllegalArgumentException- ifusernameis null.
-
upload
void upload(URLInputStreamResource fileURLResource, ClarityFile targetFile) throws ClarityUpdateException, IOException Upload a file to the Clarity file store.- Parameters:
fileURLResource- The URL resource of the file on the local machine.targetFile- The ClarityFile object that holds the reference to the uploaded file, which was newly created using the API.- Throws:
ClarityUpdateException- if the upload cannot be performed.IOException- if there is a problem with the transfer.
-
delete
Delete a file from the Clarity file store.- Parameters:
targetFile- The ClarityFile object that holds the reference to the file to delete.- Throws:
ClarityUpdateException- if the upload cannot be performed.IOException- if there is a problem with the delete.
-