Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Article rewrite completed

...

  • 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 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.

Behavior

...

with DisableErrorOnNoFilesFound = true

The default behavior of JADE is to As mentioned above, the default value for the force_files parameter is true, meaning that even if this parameter is not specified, the JADE engine will throw an error if a match is not found.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 of 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, and is specified as shown in the next screenshot:

Image Added

The effect of setting the DisableErrorOnNoFilesFound element can be demonstrated if, for example, the FileSpec regular expression in the Profile element This can be demonstrated by changing the file_spec regular expression in the profile to, for example ^text\.txt$ and recalling the profileoperation.

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

If, however, the force_files = false parameter in the example profile is commented inthe DisableErrorOnNoFilesFound element is set to true, JADE will not throw an error.

Zero-Byte Files

The JADE Client can filter handle files with zero bytes using the zero_byte_transfer parameter.

Example

in a number of ways, depending on the setting used for the TransferZeroByteFiles parameter, which is also specified as a child of the Directives element.

Test Example

The ./The test_4.txt file on our the SOS test server has zero bytes and can be used to demonstrate the use of the zero_byte_transfer TransferZeroByteFiles parameter.

Note that alternative values of the file_spec and zero_byte_transfer parameters are included in the example profile but have been commented out (using ;;). These alternative values allow the functioning of the zero_byte_transfer parameter to be properly demonstrated. The default zero_byte_transfer setting is yes.

...

languagebash

...

The default TransferZeroByteFiles setting is true. The screenshot below shows how this element is integrated in a duplicate of the ftp_server_2_local

...

file

...

transfer profile described in the first tutorial in this series.

The screenshot also shows the relevant extract from the parameter reference for TransferZeroByteFiles and the meaning of the different values it can have.

Image Added

This profile is called on Windows systems using the following commandCall the profile using:

Code Block
languagebash
jade.cmd -settings="%USERPROFILE%\jade_demo\jade_settings.ini" -profile="sftp_server_2_local_zero_byte"

...

  • With the zero_byte_transfer parameter set to relaxed (i.e. with the file_spec and zero_byte_transfer parameters set as listed above) the test_4.txt zero byte file will not be downloaded.
  • Changing the zero_byte_transfer setting to no by commenting in/out the  appropriate line in the profile and rerunning the example will:
    • cause the the test_4.txt file to be ignored as with the relaxed setting and
    • cause an error to be raised if no files with more than zero bytes are found - i.e. if no files are to be transferred.
      This can be demonstrated by activating the alternative file_spec regex (^test_[4]\.txt$) setting which will only match for the zero byte file.
  • A setting of zero_byte_transfer = strict will cause an error to be raised if any zero byte files are matched