tFileArchive
Creates a new zip, gzip, or tar.gz archive file from one or more files or
folders.
The archive file can be compressed using different
compression method.
tFileArchive Standard properties
These properties are used to configure tFileArchive running in the Standard Job framework.
The Standard
tFileArchive component belongs to the File family.
The component in this framework is available in all Talend
products.
Basic settings
Directory |
Specify the directory that contains the files to be added to the This field is available when zip Warning: Use absolute path (instead of relative path) for
this field to avoid possible errors. |
Subdirectories |
Select this check box if you want to add the files in the This field is available only when zip is selected from the Archive format list. |
Source File |
Specify the path to the file that you want to add to the archive This field is available only when gzip is selected from the Archive format list. |
Archive file |
Specify the path to the archive file to be created. Warning: Use absolute path (instead of relative path) for
this field to avoid possible errors. |
Create directory if does not exist |
Select this check box to create the destination folder if it does |
Archive format |
Select an archive file format from the list: zip, gzip, or |
Compress level |
Select the compression level you want to apply.
|
All files |
Select this check box if all files in the specified directory will
Filemask: type in the file name This check box is available when zip or tar.gz is |
Encoding |
Select an encoding type from the list or select CUSTOM and define it manually. This field This list is available when zip |
Overwrite Existing Archive |
This check box is selected by default. This allows you to save an Note:
When the replacement fails, the Job runs. |
Encrypt files |
Select this check box if you want the archive file to be password
Encrypt method: select an encrypt
AES Key Strength: select a key
Enter Password: enter the To enter the password, click the […] button next to the This check box is available only when zip is selected from the Archive format list. With this check box selected, |
ZIP64 mode |
This option allows for archives with the .zip64 extension to be
created, with three modes available:
Note that if the file size or the total size of the archive |
Advanced settings
Use sync flush |
Select this check box to flush the compressor before flushing the This check box is available when gzip or tar.gz is |
tStatCatcher Statistics |
Select this check box to gather the processing metadata at the Job |
Global Variables
Global Variables |
ARCHIVE_FILEPATH: the path to the archive file. This is
ARCHIVE_FILENAME: the name of the archive file. This is an
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component must be used as a standalone component. |
Connections |
Outgoing links (from this component to another): Row: Main; Reject; Iterate.
Trigger: On Subjob Ok; On Subjob Incoming links (from one component to this one): Row: Main; Reject; Iterate.
Trigger: Run if; On Subjob Ok; On For further information regarding connections, see |
Zipping files using a tFileArchive
recording them in the selected directory.
Procedure
-
Drop the tFileArchive component from the
Palette onto the workspace. -
Double-click it to display its Component
view. -
In the Directory field, click the […] button, browse your directory and select the
directory or the file you want to compress. -
Select the Subdirectories check box if you
want to include the subfolders and their files in the archive. -
Then, set the Archive file field, by filling
the destination path and the name of your archive file. -
Select the Create directory if not exists
check box if you do not have a destination directory yet and you want
to create it. -
In the Compress level list, select the
compression level you want to apply to your archive. In this example, we use the
normal level.
-
Clear the All Files check box if you only
want to zip specific files. -
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. - Press F6 to execute your Job.
The tFileArchive has compressed the selected file(s)
and created the folder in the selected directory.