Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is the second in a series of articles describing and describes how to get started with using the the perform simple file selection with the JADE Client via its Command Line Interface.

...

The example presented in this tutorial uses a Profile based on the ftp_server_to_local Profile described in the Getting Started tutorial.

The new Profile, has been given the profile_id = ftp_server_to_local_select_recursive and the following changes have been made:

...

The following code boxes can be opened to show the Profile and ProtocolFragments used in this example in XML and in settings.ini formats.

...

Code Block
titleThe 'ftp_server_2_local_select_recursive' Profile in settings.ini Format
collapsetrue
[protocol_fragment_ftp@ftp_demo_sos-berlin]
protocol                            = ftp

host                                = test.sos-berlin.com
user                                = demo
password                            = demo

[ftp_server_2_local_select_recursive]
operation                           = copy

source_include                      = protocol_fragment_ftp@ftp_demo_sos-berlin
file_spec                           = ^test_.\.txt$
source_dir                          = ./rec
recursive                           = true

target_protocol                     = local
target_dir                          = ${USERPROFILE}\jade_demo\a

Running the Profile

This profile is called on Windows systems using one of the following commands, depending on the JADE version being used:

...

  • JADE will download the test_1.txt from the /rec folder on the server and ignore the test.txt file whose name does not match with the file_spec FileSpec regular expression.
  • JADE will create a /sd folder in the target a directory if this folder does not already exist.
  • It will the open the /rec/sd sub-folder on the server, create a corresponding folder on the target and download the test_2.txt file to this folder.

...

The default behavior of JADE is to throw an error if a file transfer is attempted and no files are found. The DisableErrorOnNoFilesFound element is used to allow JADE to attempt a file transfer without an error being generated if no files are found. This behavior can be useful when, for example, when polling for files.

The DisableErrorOnNoFilesFound element is specified as a Directives child element, the next screenshot shows how this element is integrated in a configuration:

...

The effect of setting the DisableErrorOnNoFilesFound element can be demonstrated ifby, for example, setting the FileSpec regular expression in the Profile element to, for example to ^text\.txt$ and recalling the operation.

The file transfer will now end with an Exit - Code 99.

If, however, the DisableErrorOnNoFilesFound element is set to true, JADE will not throw an error.

...

In its original configuration - i.e. with FileSpec set to .*, the ftp_server_2_local profile transfers six files from the SOS test server to the local file system. One of these files - ./test_4.txt - has zero bytes and can be used to demonstrate the use of the TransferZeroByteFiles parameter.

...

The following code boxes can be opened to show the Profile and ProtocolFragments used in this example in XML and in settings.ini formats.

...

Code Block
titleThe 'ftp_server_2_local_zero_byte' Profile in settings.ini Format
collapsetrue
[protocol_fragment_ftp@ftp_demo_sos-berlin]
protocol                            = ftp

host                                = test.sos-berlin.com
user                                = demo
password                            = demo


[ftp_server_2_local_zero_byte]
operation                           = copy

source_include                      = protocol_fragment_ftp@ftp_demo_sos-berlin
file_spec                           = .*
source_dir                          = ./
force_files                         = false
zero_byte_transfer                  = false

target_protocol                     = local
target_dir                          = ${USERPROFILE}\jade_demo\a

Running the Profile

This profile is called on Windows systems using one of the following commands, depending on the JADE version being used:

...