FTP Plugin - Macros¶
Contents:
- # FTP_DOWNLOAD {remotePath} FROM {FTPserverTarget} AS {downloadedResourceName}
- # FTP_DOWNLOAD ASCII FILE {remotePath} FROM {FTPserverTarget} AS {downloadedResourceName}
- # FTP_DOWNLOAD BINARY FILE {remotePath} FROM {FTPserverTarget} AS {downloadedResourceName}
- # FTP_UPLOAD {localResourcePath} ONTO {FTPserverTarget} USING REMOTE PATH {remotePath}
- # FTP_UPLOAD ASCII FILE {localResourcePath} ONTO {FTPserverTarget} USING REMOTE PATH {remotePath}
- # FTP_UPLOAD BINARY FILE {localResourcePath} ONTO {FTPserverTarget} USING REMOTE PATH {remotePath}
- # FTP_DELETE {remotePathOfFileToDelete} FROM {FTPserverTarget}
- # FTP_DELETE_IF_EXISTS {remotePathOfFileToDelete} FROM {FTPserverTarget}
# FTP_DOWNLOAD {remotePath} FROM {FTPserverTarget} AS {downloadedResourceName}¶
What ?
This macro will download a resource from a FTP server.
Underlying instruction :
EXECUTE get WITH $() ON {FTPserverTarget} USING $(remotepath : {remotePath}) AS {downloadedResourceName}
> Input :
{remotePath}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to get.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target).{downloadResourceName}
: The name of the resource which references the file you download on the FTP server (file
type resource).
Example :
# FTP_DOWNLOAD path/to/example.txt FROM my-ftp-server AS example.file .properties file which contains FTP information :
.properties must be in “targets” folder of your project :
SKF script :
FTP confirms that the example.txt has been downloaded :
You can see the downloaded file in SQUASH_TA temporary files folder :
Here is the downloaded file :
# FTP_DOWNLOAD ASCII FILE {remotePath} FROM {FTPserverTarget} AS {downloadedResourceName}¶
What ?
This macro will download an ASCII type resource from a FTP server.
Underlying instruction :
EXECUTE get WITH $() ON {FTPserverTarget} USING $(remotepath : {remotePath},filetype : ascii) AS {downloadedResourceName}
> Input :
{remotePath}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to get.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target).{downloadResourceName}
: The name of the resource which references the file you download on the FTP server (file
type resource).
Example :
# FTP_DOWNLOAD ASCII FILE path/to/example.txt FROM my-ftp-server AS example.file This example is based on the first one. For more details, please check here.
SKF script :
FTP transfer mode is set to ASCII :
# FTP_DOWNLOAD BINARY FILE {remotePath} FROM {FTPserverTarget} AS {downloadedResourceName}¶
What ?
This macro will download a binary type resource from a FTP server.
Underlying instruction :
EXECUTE get WITH $() ON {FTPserverTarget} USING $(remotepath : {remotePath},filetype : binary) AS {downloadedResourceName}
> Input :
{remotePath}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to get.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target).{downloadResourceName}
: The name of the resource which references the file you download on the FTP server (file
type resource).
Example :
# FTP_DOWNLOAD BINARY FILE path/to/example.bin FROM my-ftp-server AS example.file This example is based on the first one. For more details, please check here.
SKF script :
# FTP_UPLOAD {localResourcePath} ONTO {FTPserverTarget} USING REMOTE PATH {remotePath}¶
What ?
This macro will upload a resource on a FTP server.
Underlying instructions :
LOAD {localResourcePath} AS __temp_{%%rand1}.file
EXECUTE put WITH __temp_{%%rand1}.file ON {FTPserverTarget} USING $(remotepath : {remotePath}) AS {{whocares}}
> Input :
{localResourcePath}
: The path of the file you want to upload on the FTP server.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target){remotePath}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to put.
Example :
# FTP_UPLOAD path/to/example.txt ONTO my-ftp-server USING REMOTE PATH abc/name.txt File to upload :
File location :
.properties file which contains FTP information :
.properties must be in “targets” folder of your project :
SKF script :
FTP confirms that the uploadExample.txt has been uploaded :
# FTP_UPLOAD ASCII FILE {localResourcePath} ONTO {FTPserverTarget} USING REMOTE PATH {remotePath}¶
What ?
This macro will upload an ASCII type resource on a FTP server.
Underlying instruction :
LOAD {localResourcePath} AS __temp_{%%rand1}.file
EXECUTE put WITH __temp_{%%rand1}.file ON {FTPserverTarget} USING $(remotepath : {remotePath},filetype : ascii) AS {{whocares}}
> Input :
{localResourcePath}
: The path of the file you want to upload on the FTP server.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target){remotePath}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to put.
Example :
# FTP_UPLOAD ASCII FILE path/to/example.txt ONTO my-ftp-server USING REMOTE PATH abc/name.txt This example is based on the previous one. For more details, please check here.
SKF script :
FTP transfer mode is set to ASCII :
# FTP_UPLOAD BINARY FILE {localResourcePath} ONTO {FTPserverTarget} USING REMOTE PATH {remotePath}¶
What ?
This macro will upload a binary type resource on a FTP server.
Underlying instruction :
LOAD {localResourcePath} AS __temp_{%%rand1}.file
EXECUTE put WITH __temp_{%%rand1}.file ON {FTPserverTarget} USING $(remotepath : {remotePath},filetype : binary) AS {{whocares}}
> Input :
{localResourcePath}
: The path of the file you want to upload on the FTP server.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target){remotePath}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to put.
Example :
# FTP_UPLOAD BINARY FILE path/to/example.bin ONTO my-ftp-server USING REMOTE PATH abc/name.bin This example is based on the previous one. For more details, please check here.
SKF script :
# FTP_DELETE {remotePathOfFileToDelete} FROM {FTPserverTarget}¶
What ?
This macro will delete a file on a FTP server.
Underlying instruction :
EXECUTE delete WITH $() ON {FTPserverTarget} USING $(remotepath : {remotePathOfFileToDelete}) AS {{whocares}}
> Input :
{remotePathOfFileToDelete}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to delete.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target).
Example :
# FTP_DELETE distant/path/example.txt FROM my-ftp-server .properties file which contains FTP information :
.properties must be in “targets” folder of your project :
SKF script :
FTP confirms that the file has been deleted :
# FTP_DELETE_IF_EXISTS {remotePathOfFileToDelete} FROM {FTPserverTarget}¶
What ?
This macro will delete a resource on a FTP server. If the file doesn’t exist, the macro doesn’t fail.
Underlying instruction :
EXECUTE delete WITH $() ON {FTPserverTarget} USING $(remotepath : {remotePathOfFileToDelete},failIfDoesNotExist:false) AS {{whocares}}
> Input :
{remotePathOfFileToDelete}
: It corresponds to the file path on the FTP server, relatively to the home directory of the file you want to delete.{FTPserverTarget}
: The name (in the context) of the FTP server to use (ftp.target
type target).
Example :
# FTP_DELETE_IF_EXISTS distant/path/example.txt FROM my-ftp-server This example is similar to the previous one. For more details, please check here.