August 17, 2023

tFileArchive – Docs for ESB 5.x

tFileArchive

tFileArchive_icon32.png

tFileArchive properties

Component Family

File/Management

 

Function

The tFileArchive zips one or more
files according to the parameters defined and places the archive
created in the selected directory.

Purpose

Use this component to zip one or more files for processing.

Basic settings

Directory

The directory that contains files to be zipped.

Subdirectories: Select this check
box if you want to zip files in the subdirectories of the selected
directory.

 

Archive file

Destination path and name of the result archive file.

 

Compress level

Select the compression level you want to apply.

Best: the compression quality
will be optimum, but the compression time will be long.

Normal: compression quality and
time will be average.

Fast (no compression):
compression will be fast, but quality will be lower.

 

All files

Select this check box if you want all files in the directory to be
zipped. Clear it to specify the file(s) you want to zip in the
Files table.

Filemask: type in a file name or
a file mask using a special character or a regular
expression.

 

Create directory if not exists

This check box is selected by default. It creates a destination
folder for the output table if it does not already exist.

 

Encoding

Select the encoding type from the list or select Custom and define it manually. This field
is compulsory for DB data handling.

 

Overwrite Existing Archive

This check box is selected by default. This allows you to save an
archive by replacing the existing one. But if you clear the check
box, an error is reported, the replacement fails and the new archive
cannot be saved.

Note

When the replacement fails, the Job runs.

 

Encrypt files

Select this check box if you want your archive to be password
protected. The Enter Password text
box appears to let you enter your password.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

With this option used, the result archive file can be unzipped
only by the tFileUnarchive
component and not by a common archiver. For information on tFileUnarchive, see tFileUnarchive

 

ZIP64 mode

This option allows for archives with the .zip64 extension to be
created, with three modes available:

  • ASNEEDED: archives with the .zip64 extension will be
    automatically created based on the file size.

  • ALWAYS: archives with the .zip64 extension will be
    created, no matter what size the file may be.

  • NEVER: no archives with the .zip64 extension will be
    created, no matter what size the file may be.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the processing metadata at the Job
level as well as at each component level.

Global Variables

ARCHIVE_FILEPATH: the path to the archive file. This is
an After variable and it returns a string.

ARCHIVE_FILENAME: the name of the archive file. This is an
After variable and it returns a string.

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Connections

Outgoing links (from this component to another):

Row: Main; Reject; Iterate.

Trigger: On Subjob Ok; On Subjob
Error; Run if; On Component Ok; On Component Error.

Incoming links (from one component to this one):

Row: Main; Reject; Iterate.

Trigger: Run if; On Subjob Ok; On
Subjob Error; On component Ok; On Component Error; Synchronize;
Parallelize.

For further information regarding connections, see
Talend Studio
User Guide.

Usage

This component must be used as a standalone component.

Log4j

The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User
Guide
.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

n/a

Scenario: Zip files using a tFileArchive

This scenario creates a Job with a unique component. It aims at zipping files and
recording them in the selected directory.

  1. Drop the tFileArchive component from the
    Palette onto the workspace.

  2. Double-click it to display its Component
    view.

    Use_Case_tFileArchive1.png
  3. In the Directory field, click the […] button, browse your directory and select the
    directory or the file you want to compress.

  4. Select the Subdirectories check box if you
    want to include the subfolders and their files in the archive.

  5. Then, set the Archive file field, by filling
    the destination path and the name of your archive file.

  6. Select the Create directory if not exists
    check box if you do not have a destination directory yet and you want
    to create it.

  7. In the Compress level list, select the
    compression level you want to apply to your archive. In this example, we use the
    normal level.

  8. Clear the All Files check box if you only
    want to zip specific files.

    Use_Case_tFileArchive2.png
  9. Add a row in the table by clicking the [+]
    button and click the name which appears. Between two star symbols
    (ie. *RG*), type part of the name of the file that you want to compress.

  10. Press F6 to execute your Job.

The tFileArchive has compressed the selected file(s)
and created the folder in the selected directory.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x