SFTP Input Context

  • Context Variable: service
  • Only applicable to SFTP Input

API Interface

//Delete a file in the remote site
void delete(String path);

//Create a directory in the remote site
void makeDir(String path);

//Delete a directory and its contents in the remote site
void deleteDir(String path);

//Download a file as byte array from the remote site
byte[] downloadFile(String path);

//Upload a byte array as a file to the remote site
void uploadFile(String path, byte[] data);

//Upload a byte array as a file to the remote site
void uploadFile(String path, String fileName, byte[] data);

//Stops the input service
void stop();

//Gets the input service's config ID
String getId();

//Retrieves the entity type [DOMAIN, ORGANIZATION, GLOBAL, SYSTEM]
EntityType getEntityType();

//Gets the input service's org id 
Long getOrgId();

Related Context APIs

Inputs Context
File Context
Context Base

Example

def content = "Your report content";
inputs.getTcp("MY_SFTP_INPUT_ID").uploadFile("/data/outgoing/reports", "report.txt",  content.getBytes());