August 17, 2023

tFileProperties – Docs for ESB 5.x

tFileProperties

tFileProperties_icon32_white.png

tFileProperties Properties

Component family

File/Management

 

Function

tFileProperties creates a single
row flow that displays the properties of the processed file.

Purpose

tFileProperties obtains
information about the main properties of a defined file.

Basic settings

Schema and Edit
schema

A schema is a row description, it defines the fields to be processed and passed on to
the next component.

The schema of this component is read-only. It describes the main
properties of the specified file. You can click the […] button next to Edit schema to view the predefined schema
which contains the following fields:

  • abs_path: the absolute
    path of the file.

  • dirname: the directory of
    the file.

  • basename: the name of the
    file.

  • mode_string: the access
    mode of the file, r and
    w for read and write
    permissions respectively.

  • size: the file size in
    bytes.

  • mtime: the timestamp
    indicating when the file was last modified, in milliseconds
    that have elapsed since the Unix epoch (00:00:00 UTC, Jan 1,
    1970).

  • mtime_string: the date
    and time the file was last modified.

 

File

Name or path to the file to be processed and/or the variable to be
used.

For further information about how to define and use a variable in
a Job, see Talend Studio
User Guide.

 

Calculate MD5 Hash

Select this check box to check the MD5 of the downloaded
file.

Advanced settings

tStatCatcher Statistics

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

Usage

This component can be used as standalone component.

Connections

Outgoing links (from this component to another):

Row: Main; 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: 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.

Global Variables

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.

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: Displaying the properties of a processed file

This Java scenario describes a very simple Job that displays the properties of the
specified file.

  1. Drop a tFileProperties component and a
    tLogRow component from the Palette onto the design workspace.

  2. Right-click on tFileProperties and connect it
    to tLogRow using a Main
    Row
    link.

    Use_Case_tFileProperties.png
  3. In the design workspace, select tFileProperties.

  4. Click the Component tab to define the basic
    settings of tFileProperties.

    Use_Case_tFileProperties1.png
  5. Set Schema type to Built-In.

  6. If desired, click the Edit schema button to
    see the read-only columns.

  7. In the File field, enter the file path or
    browse to the file you want to display the properties for.

  8. In the design workspace, select tLogRow and
    click the Component tab to define its basic
    settings. For more information, see tLogRow.

  9. Press F6 to execute the Job.

    Use_Case_tFileProperties3.png

The properties of the defined file are displayed on the console.


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