ComposantsComponents › Internet
Rapatrie un fichier par HTTP, HTTPS ou FTP (et SMB v1, déprécié) et l'enregistre dans un dossier, ou le garde ouvert comme flux pour un autre composant (Utiliser le cache). En HTTP, la requête peut aussi être un formulaire POST, avec des champs et des fichiers joints. Clients : Apache HttpClient 4.5 en HTTP et HTTPS, celui de Java en FTP. La méthode POST est cochée par défaut : pour un simple téléchargement, décochez-la. Fetches a file through HTTP, HTTPS or FTP (and SMB v1, deprecated) and saves it to a folder, or keeps it open as a stream for another component (Use cache). In HTTP, the request can also be a POST form, with fields and attached files. Clients: Apache HttpClient 4.5 in HTTP and HTTPS, the Java one in FTP. The POST method is checked by default: for a plain download, uncheck it.
EntréeInput
Un lien Main ou Iterate, facultatif : un téléchargement par ligne ou par itération.One Main or Iterate link, optional: one download per row or per iteration.
SortieOutput
Un fichier sur le disque, ou le flux INPUT_STREAM. Pas de schéma.A file on the disk, or the INPUT_STREAM stream. No schema.
Déclencheurs en sortieOutput triggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
Le tFileFetch enregistre le fichier, puis le tFileInputDelimited le lit, sur le disque ou, avec Utiliser le cache, directement dans le flux reçu (voir Le cache). The tFileFetch saves the file, then the tFileInputDelimited reads it, on the disk or, with Use cache, directly in the stream received (see The cache).
Chaque ligne déclenche un téléchargement ; l'URI lit la ligne : "http://127.0.0.1:54525/files/data/" + row1.file.
Each row triggers a download; the URI reads the row: "http://127.0.0.1:54525/files/data/" + row1.file.
defaultfilename.txt (voir Le nom du fichier).Give the URI, the Destination directory and, preferably, the Destination filename: the name deduced from the URI is often defaultfilename.txt (see The file name).Les libellés sont ceux de l'onglet Composant ; le nom technique, en gris, est celui du paramètre dans le fichier du job. « HTTP(S) » : protocole http ou https. Labels are those of the Component tab; the technical name, in grey, is the parameter name in the job file. "HTTP(S)": http or https protocol.
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| ProtocoleProcotolPROTO | http | ToujoursAlways | HTTP, HTTPS, ftp ou smbv1 (Déprécié). Le libellé anglais porte la faute Procotol. http, https, ftp or smbv1 (Deprecated). The English label carries the typo Procotol. |
| URIURI | "http://talendforge.org/file_fetch.txt" |
Sauf SMBExcept SMB |
Adresse du fichier, expression Java. En FTP, l'utilisateur et le mot de passe vont dans l'URI : "ftp://demo:demo@127.0.0.1:54531/in/products.csv". Une adresse non encodée (espace…) demande Encoder l'URI.
Address of the file, a Java expression. In FTP, the user and the password go in the URI: "ftp://demo:demo@127.0.0.1:54531/in/products.csv". An unencoded address (space…) needs Encode URI.
|
| Utiliser le cache pour sauver la ressourceUse cache to save the resourceUSE_CACHE | NonNo | ToujoursAlways |
N'écrit rien sur le disque : le flux de la réponse est mis dans INPUT_STREAM, pour le composant suivant. Voir Le cache.
Writes nothing to the disk: the stream of the response is put in INPUT_STREAM, for the next component. See The cache.
|
| Répertoire de destinationDestination directoryDIRECTORY | "C:" |
Cache décochéCache unchecked | Dossier où le fichier est écrit, créé s'il manque. Un fichier de même nom est écrasé. Folder where the file is written, created if missing. A file with the same name is overwritten. |
| Créer un chemin d'accès complet selon l'URICreate full path according to URIMAKEDIRS | NonNo | Sauf SMB, cache décochéExcept SMB, cache unchecked |
Ajoute au dossier les dossiers du chemin de l'URI : /files/data/products.csv est écrit sous files/data/.
Adds to the folder the folders of the path of the URI: /files/data/products.csv is written under files/data/.
|
| Nom du fichier de destinationDestination filenameFILENAME | "" |
Cache décochéCache unchecked | Nom du fichier écrit. Vide, il est déduit de l'URI (voir Le nom du fichier). Name of the written file. Empty, it is deduced from the URI (see The file name). |
| Ajouter un en-tête / En-têtesAdd header / HeadersADD_HEADER, HEADERS | Non, videNo, empty | HTTP(S) ; la table si la case est cochéeHTTP(S); the table if the box is checked |
Table Nom / Valeur, deux expressions Java : "Accept" / "text/csv".
Name / Value table, two Java expressions: "Accept" / "text/csv".
|
| Méthode POSTPOST methodPOST | OuiYes | HTTP(S) |
Cochée : un POST multipart/form-data, vide si aucun paramètre n'est donné. Décochée : un GET. Voir Le formulaire POST.
Checked: a multipart/form-data POST, empty if no parameter is given. Unchecked: a GET. See The POST form.
|
| Domaine / Utilisateur / Mot de passe (SMB)Domain / Username / Password (SMB)SMB_URI, SMB_DOMAIN, SMB_USERNAME, SMB_PASSWORD | "smb://host/dir/remoteFileName.txt", "domain", "username", "password" |
SMB | Fichier partagé en SMB v1 et compte du domaine. Non essayé. File shared in SMB v1 and account of the domain. Not tried. |
| Arrêter en cas d'erreurDie on errorDIE_ON_ERROR | OuiYes | Sauf SMBExcept SMB | Cochée, une réponse hors 2xx ou une panne arrête le job. Décochée, l'erreur est écrite sur la sortie d'erreur et le job continue (voir Les erreurs). Checked, a response outside 2xx or a failure stops the job. Unchecked, the error is written to the error output and the job goes on (see Errors). |
| ParamètresParametersCOMMON_PARAMS | videempty | HTTP(S), POST cochéHTTP(S), POST checked | Table Nom / Valeur : les champs texte du formulaire. Name / Value table: the text fields of the form. |
| Lire le cookie / Sauvegarder le cookieRead cookie / Save cookieREAD_COOKIE, SAVE_COOKIE | Non, NonNo, No | HTTP(S) | Charge avant la requête les cookies enregistrés dans le fichier, et/ou y enregistre après la requête ceux du serveur. Pour garder une session entre deux tFileFetch. Loads before the request the cookies saved in the file, and/or saves into it after the request those of the server. To keep a session between two tFileFetch. |
| Répertoire des cookiesCookie directoryCOOKIE_DIR | "C:/cookie" |
HTTP(S), lecture ou sauvegarde cochéeHTTP(S), read or save checked | Malgré le libellé, un fichier : les cookies y sont écrits par la sérialisation de Java, et son dossier est créé au besoin. Despite the label, a file: the cookies are written into it by Java serialization, and its folder is created if needed. |
| Politique de cookies (dépréciée)Cookie policy (Deprecated)COOKIE_POLICY | DéfautDEFAULT | Comme le fichier des cookiesAs the cookie file | Lue par le modèle mais sans effet : la politique de la bibliothèque s'applique. Read by the template but without effect: the policy of the library applies. |
| En-tête du cookieSingle cookie headerSINGLE_COOKIE | NonNo | Comme le fichier des cookiesAs the cookie file |
Envoie tous les cookies dans un seul en-tête Cookie.
Sends all the cookies in a single Cookie header.
|
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Délai avant expirationTimeoutTIMEOUT | 30000 |
HTTP(S) | En millisecondes, pour ouvrir la connexion seulement : l'attente de la réponse n'est pas limitée. In milliseconds, to open the connection only: the wait for the response is not limited. |
| Encoder l'URIEncode URIENCODE_URI | NonNo | HTTP(S) |
Encode l'URI avant l'appel (my report.txt devient my%20report.txt). Le nom du fichier déduit reste encodé.
Encodes the URI before the call (my report.txt becomes my%20report.txt). The deduced file name stays encoded.
|
| Encodage pour les paramètresEncoding for parametersCOMMON_PARAMS_CHARSET | UTF-8 | HTTP(S), POST cochéHTTP(S), POST checked | Sans effet dans Talaxie 9.0.6 : le modèle le lit mais ne s'en sert pas ; les champs partent en ISO-8859-1 (voir Le formulaire POST). Without effect in Talaxie 9.0.6: the template reads it but does not use it; the fields leave as ISO-8859-1 (see The POST form). |
| Afficher la réponse dans la consolePrint response to consolePRINT | NonNo | HTTP(S) | Affiche la ligne de statut et les en-têtes de la réponse, pas son contenu. Displays the status line and the headers of the response, not its content. |
| Charger le fichier / FichiersUpload file / FilesUPLOAD, FILE_PARAMS | Non ; Type de contenu "application/octet-stream", Jeu de caractères "ISO-8859-1"No; Content-Type "application/octet-stream", Charset "ISO-8859-1" |
HTTP(S), POST coché ; la table si la case est cochéeHTTP(S), POST checked; the table if the box is checked |
Fichiers joints au formulaire : Nom du champ, Fichier (chemin), Type de contenu de la partie, Jeu de caractères. Ce dernier s'ajoute à l'en-tête Content-Type de toute la requête, pas à la partie.
Files attached to the form: Name of the field, File (path), Content-Type of the part, Charset. The latter is added to the Content-Type header of the whole request, not to the part.
|
| Activer un serveur proxyEnable proxy serverUSE_PROXY | NonNo | Sauf SMBExcept SMB | En HTTP(S), proxy HTTP du composant seul. En FTP, proxy SOCKS posé dans les propriétés de la JVM (voir Proxy et HTTPS). In HTTP(S), HTTP proxy of the component alone. In FTP, SOCKS proxy set in the properties of the JVM (see Proxy and HTTPS). |
| Hôte / Port / Utilisateur(trice) / Mot de passe du proxyProxy host / port / user / passwordPROXY_HOST, PROXY_PORT, PROXY_USERNAME, PROXY_PASSWORD | "127.0.0.1", "8080", "", "" |
Proxy cochéProxy checked |
Le port est une chaîne ("3128").
The port is a string ("3128").
|
| Activer les identifiants NTLM / DomaineEnable NTLM Credentials / DomainPROXY_NTLM, PROXY_DOMAIN | NonNo, "" |
HTTP(S) ; le domaine si la case est cochéeHTTP(S); the domain if the box is checked | Compte NTLM (avec domaine) pour le proxy ; sans proxy, avec Authentification requise, pour le serveur. Non essayé. NTLM account (with domain) for the proxy; without proxy, with Need authentication, for the server. Not tried. |
| Authentification requise / Utilisateur / Mot de passeNeed authentication / Username / PasswordNEED_AUTH, AUTH_USERNAME, AUTH_PASSWORD | NonNo, "username", "password" |
HTTP(S) ; le compte si la case est cochéeHTTP(S); the account if the box is checked | Compte donné au serveur qui répond 401 (Basic, Digest…), pour cet appel seulement. Account given to the server that answers 401 (Basic, Digest…), for this call only. |
| Supporter la redirection / Forcer la méthode GET pour la redirection 302Support redirection / Force GET method for 302 redirectionREDIRECT, REDIRECT_302_AS_303 | Non, NonNo, No | HTTP(S) ; la seconde si la première est cochéeHTTP(S); the second one if the first one is checked | Suit les redirections d'un POST. Les redirections d'un GET sont suivies dans tous les cas. Voir Les redirections. Follows the redirects of a POST. The redirects of a GET are followed in every case. See Redirects. |
| Faire confiance à tous les serveursTrust all serversTRUST_ALL_SERVER | NonNo | HTTPS | Accepte n'importe quel certificat de serveur, sans truststore. Accepts any server certificate, with no truststore. |
Sans Nom du fichier de destination, le composant prend la fin du chemin de l'URI, après le dernier /, requête comprise. Il se rabat sur defaultfilename.txt si le fichier est à la racine du serveur, si le chemin finit par /, ou si le nom n'est pas valide pour le système. Noms obtenus lors de nos essais (Windows) :
Without Destination filename, the component takes the end of the path of the URI, after the last /, query included. It falls back on defaultfilename.txt if the file is at the root of the server, if the path ends with /, or if the name is not valid for the system. Names obtained in our runs (Windows):
| Chemin de l'URIPath of the URI | RéglageSetting | Fichier écritWritten file |
|---|---|---|
/files/data/products.csv | défautdefault | products.csv |
/files/data/products.csv | Créer un chemin d'accès completCreate full path | files/data/products.csv |
/files/data/products.csv | Nom "products_" + TalendDate.formatDate("yyyyMMdd", …) + ".csv"Name "products_" + TalendDate.formatDate("yyyyMMdd", …) + ".csv" | products_20261121.csv |
/files/data/products.csv?day=2026-11-21 | défautdefault | defaultfilename.txt (? interdit dans un nom Windows)defaultfilename.txt (? forbidden in a Windows name) |
/reports/2026/ | défautdefault | defaultfilename.txt |
/latest (à la racine)/latest (at the root) | défautdefault | defaultfilename.txt |
/files/my report.txt | Encoder l'URIEncode URI | my%20report.txt |
Un fichier à la racine (http://serveur/data.csv) n'est donc jamais enregistré sous son nom : le modèle ne prend un nom qu'après un / qui n'est pas le premier (défaut de Talaxie 9.0.6). Hors Windows, la requête (?day=…) entre dans le nom. Donnez toujours le nom.
A file at the root (http://server/data.csv) is therefore never saved under its name: the template only takes a name after a / that is not the first one (defect of Talaxie 9.0.6). Outside Windows, the query (?day=…) goes into the name. Always give the name.
Méthode POST cochée, le composant envoie toujours un corps multipart/form-data : les Paramètres en parties texte, les Fichiers en parties binaires. Sans paramètre, le corps est vide ; avec le réglage par défaut, un simple téléchargement part donc ainsi (journal du serveur d'essai, en-têtes communs omis) :
POST method checked, the component always sends a multipart/form-data body: the Parameters as text parts, the Files as binary parts. Without parameter, the body is empty; with the default setting, a plain download thus leaves like this (log of the test server, common headers left out):
[http] POST /files/data/products.csv HTTP/1.1 [http] Content-Length: 37 [http] Content-Type: multipart/form-data; boundary=UQtn1Sp1WDoClRehxgGvPGZxiAAAa4V [http] | --UQtn1Sp1WDoClRehxgGvPGZxiAAAa4V-- [http] | [http] -> 200 (56 bytes)
Le serveur d'essai sert le fichier quelle que soit la méthode ; un vrai serveur de fichiers répond souvent 405 à un POST. The test server serves the file whatever the method; a real file server often answers 405 to a POST.
Paramètres "name" / "Ada" et "dish" / "Crème brûlée", Encodage pour les paramètres UTF-8 (défaut). Corps reçu, en octets (\xe8 est le è d'ISO-8859-1) :
Parameters "name" / "Ada" and "dish" / "Crème brûlée", Encoding for parameters UTF-8 (default). Body received, as bytes (\xe8 is the ISO-8859-1 è):
[http] | b'--et2gME6eG_fi4emwhBpIIcGvMGH4LYpxaAw9GF\r\nContent-Disposition: form-data; name="name"\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: 8bit\r\n\r\nAda\r\n--et2gME6eG_fi4emwhBpIIcGvMGH4LYpxaAw9GF\r\nContent-Disposition: form-data; name="dish"\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: 8bit\r\n\r\nCr\xe8me br\xfbl\xe9e\r\n--et2gME6eG_fi4emwhBpIIcGvMGH4LYpxaAw9GF--\r\n'
Les champs partent en ISO-8859-1 malgré le réglage UTF-8 : un caractère hors de ce jeu (€, lettres non latines) devient ?. Défaut de Talaxie 9.0.6.
The fields leave as ISO-8859-1 despite the UTF-8 setting: a character outside this set (€, non-Latin letters) becomes ?. Defect of Talaxie 9.0.6.
Paramètres "batch" / "42" ; Charger le fichier, Fichiers : "file", upload.csv, "text/csv", "UTF-8". Journal du serveur :
Parameters "batch" / "42"; Upload file, Files: "file", upload.csv, "text/csv", "UTF-8". Log of the server:
[http] POST /upload HTTP/1.1 [http] Content-Length: 409 [http] Content-Type: multipart/form-data; boundary=jQHiewZP9FIMK8O7rmdr22vdds5Ph-fceU6OS; charset=UTF-8 … [http] | --jQHiewZP9FIMK8O7rmdr22vdds5Ph-fceU6OS [http] | Content-Disposition: form-data; name="batch" [http] | Content-Type: text/plain; charset=ISO-8859-1 [http] | Content-Transfer-Encoding: 8bit [http] | [http] | 42 [http] | --jQHiewZP9FIMK8O7rmdr22vdds5Ph-fceU6OS [http] | Content-Disposition: form-data; name="file"; filename="upload.csv" [http] | Content-Type: text/csv [http] | Content-Transfer-Encoding: binary [http] | [http] | id;name [http] | 1;Ada [http] | 2;Grace [http] | [http] | --jQHiewZP9FIMK8O7rmdr22vdds5Ph-fceU6OS-- [http] | [http] -> 200 (196 bytes)
Le fichier part octet pour octet ; le jeu de caractères choisi s'ajoute à l'en-tête de toute la requête. La réponse du serveur est enregistrée comme fichier téléchargé. The file leaves byte for byte; the chosen character set is added to the header of the whole request. The response of the server is saved as the downloaded file.
Adresse /latest, qui répond 302 vers /files/report.txt, nom du fichier laissé vide :
/latest address, which answers 302 to /files/report.txt, file name left empty:
| MéthodeMethod | Supporter la redirectionSupport redirection | RésultatResult |
|---|---|---|
| GET | décochée ou cochéeunchecked or checked | Suivie par le client HTTP ; fichier nommé d'après l'URI d'origine : defaultfilename.txtFollowed by the HTTP client; file named from the original URI: defaultfilename.txt |
| POST | décochéeunchecked | Erreur Method failed: HTTP/1.1 302 Found, job arrêtéError Method failed: HTTP/1.1 302 Found, job stopped |
| POST | cochéechecked | Redirect to: http://127.0.0.1:54525/files/report.txt dans la console, puis un nouveau POST sans corps (Content-Length: 0) ; fichier report.txtRedirect to: http://127.0.0.1:54525/files/report.txt in the console, then a new POST with no body (Content-Length: 0); file report.txt |
| POST | cochée, avec Forcer la méthode GETchecked, with Force GET method | Même message, puis un GET ; fichier report.txtSame message, then a GET; file report.txt |
Les champs et fichiers du formulaire ne sont pas renvoyés à la nouvelle adresse. D'après le modèle, une redirection relative vers une URI écrite sans port donnerait une adresse en :-1 ; non essayé.
The fields and files of the form are not sent again to the new address. According to the template, a relative redirect to a URI written without a port would give an address with :-1; not tried.
Utiliser le cache coché, URI "…/files/data/products.csv", GET. Le tFileInputDelimited lit le flux à la place d'un fichier : Nom de fichier (java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM"), séparateur ";", une ligne d'en-tête, schéma id, name, price :
Use cache checked, URI "…/files/data/products.csv", GET. The tFileInputDelimited reads the stream instead of a file: File name (java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM"), separator ";", one header line, schema id, name, price:
1|Notebook|3.50 2|Pen|1.20 3|Stapler|8.90
Le flux est celui de la connexion : il se lit une seule fois, et reste ouvert jusqu'à l'exécution suivante du composant, qui ferme le précédent. Le cache n'a été essayé qu'en HTTP. The stream is the one of the connection: it can be read only once, and stays open until the next run of the component, which closes the previous one. The cache was only tried in HTTP.
Sorties copiées de l'exécution de jobs dans Talaxie (Java 21), contre un serveur HTTP d'essai (127.0.0.1:54525) et un serveur FTP d'essai (127.0.0.1:54531, compte fictif demo / demo). Chaque tFileFetch est suivi, par On Subjob Ok, d'un tJava qui affiche les fichiers du dossier de destination.
Outputs copied from runs of jobs in Talaxie (Java 21), against a test HTTP server (127.0.0.1:54525) and a test FTP server (127.0.0.1:54531, fictitious account demo / demo). Each tFileFetch is followed, through On Subjob Ok, by a tJava that displays the files of the destination folder.
http, Méthode POST décochée, URI "http://127.0.0.1:54525/files/data/products.csv", nom vide :http, POST method unchecked, URI "http://127.0.0.1:54525/files/data/products.csv", empty name:
products.csv (56 bytes) id;name;price 1;Notebook;3.50 2;Pen;1.20 3;Stapler;8.90
Journal du serveur :Log of the server:
[http] GET /files/data/products.csv HTTP/1.1 [http] Host: 127.0.0.1:54525 [http] Connection: Keep-Alive [http] User-Agent: Apache-HttpClient/4.5.13 (Java/21.0.12.1) [http] Accept-Encoding: gzip,deflate [http] -> 200 (56 bytes)
ftp, URI "ftp://demo:demo@127.0.0.1:54531/in/products.csv". La console affiche le même fichier ; journal du serveur FTP (mot de passe masqué par le serveur) :ftp, URI "ftp://demo:demo@127.0.0.1:54531/in/products.csv". The console displays the same file; log of the FTP server (password masked by the server):
[ftp] 62347 < 220 Demo FTP server ready [ftp] 62347 > USER demo [ftp] 62347 < 331 Password required for demo. [ftp] 62347 > PASS **** [ftp] 62347 < 230 User demo logged in. [ftp] 62347 > TYPE I [ftp] 62347 < 200 Type set to I. [ftp] 62347 > CWD in [ftp] 62347 < 250 Directory successfully changed. [ftp] 62347 > EPSV ALL [ftp] 62347 < 229 Entering Extended Passive Mode (|||62348|). [ftp] 62347 > EPSV [ftp] 62347 < 229 Entering Extended Passive Mode (|||62349|). [ftp] 62347 > RETR products.csv [ftp] 62347 < 150 Opening BINARY mode data connection for products.csv (56 bytes). [ftp] 62347 sent 56 bytes [ftp] 62347 < 226 Transfer complete. [ftp] 62347 > QUIT [ftp] 62347 < 221 Goodbye. [ftp] 62347 closed
Mode passif, binaire. Le client FTP de Java n'a aucun réglage dans le composant.Passive, binary mode. The FTP client of Java has no setting in the component.
GET "…/files/report.txt", Afficher la réponse dans la console cochée :GET "…/files/report.txt", Print response to console checked:
Status Line: HTTP/1.1 200 OK *** Response Header *** Server: DemoHTTP/1.0 Date: Sat, 21 Nov 2026 14:57:16 GMT Content-Type: application/octet-stream Content-Length: 35 report.txt (35 bytes) Monthly report All systems normal.
Les quatre premières lignes viennent du composant, la suite du tJava.The first four lines come from the component, the rest from the tJava.
tFileFetch_1 appelle /cookie/set (le serveur pose session=abc123) avec Sauvegarder le cookie ; tFileFetch_2 appelle /cookie/show avec Lire le cookie, même fichier de cookies :tFileFetch_1 calls /cookie/set (the server sets session=abc123) with Save cookie; tFileFetch_2 calls /cookie/show with Read cookie, same cookie file:
set.txt (11 bytes) Cookie set show.txt (30 bytes) Cookie header: session=abc123
"…/auth/basic", Authentification requise, "demo" / "demo" : le fichier welcome.txt contient Welcome demo. Journal du serveur, en-têtes communs omis :"…/auth/basic", Need authentication, "demo" / "demo": the welcome.txt file holds Welcome demo. Log of the server, common headers left out:
[http] GET /auth/basic HTTP/1.1 [http] -> 401 (24 bytes) [http] GET /auth/basic HTTP/1.1 [http] Authorization: Basic ZGVtbzpkZW1v [http] -> 200 (13 bytes)
Deux lignes, products.csv et missing.csv, Arrêter en cas d'erreur décochée ; le tJava suit le tFixedFlowInput par On Subjob Ok (pile abrégée) :Two rows, products.csv and missing.csv, Die on error unchecked; the tJava follows the tFixedFlowInput through On Subjob Ok (shortened stack):
There isContinue_tFileFetch_1 an exception on: http://127.0.0.1:54525/files/data/missing.csv java.lang.Exception: Method failed: HTTP/1.1 404 Not Found … products.csv (56 bytes) id;name;price 1;Notebook;3.50 2;Pen;1.20 3;Stapler;8.90
Seules les options du composant comptent : un tSetProxy n'a pas d'effet. Proxy d'essai qui demande l'utilisateur fictif proxyuser :Only the options of the component count: a tSetProxy has no effect. Test proxy that asks for the fictitious user proxyuser:
[proxyauth] GET http://127.0.0.1:54525/files/report.txt HTTP/1.1 [proxyauth] -> 407 [proxyauth] GET http://127.0.0.1:54525/files/report.txt HTTP/1.1 [proxyauth] Proxy-Authorization: Basic cHJveHl1c2VyOnByb3h5cGFzcw== [proxyauth] -> 200 (35 bytes, from 127.0.0.1:54525)
En FTP, Activer un serveur proxy écrit socksProxyHost, socksProxyPort, java.net.socks.username et java.net.socks.password dans les propriétés de la JVM : toutes les connexions qui suivent dans le job passent par ce proxy SOCKS. L'utilisateur et le mot de passe ne sont pas lus par Java 21 (voir tSetProxy). Essai avec un proxy SOCKS sans compte, job lancé avec -Dftp.nonProxyHosts= pour que 127.0.0.1 y passe : le proxy a relayé la connexion de commande et celle des données.In FTP, Enable proxy server writes socksProxyHost, socksProxyPort, java.net.socks.username and java.net.socks.password to the properties of the JVM: all the connections that follow in the job go through this SOCKS proxy. The user and the password are not read by Java 21 (see tSetProxy). Run with a SOCKS proxy without account, job started with -Dftp.nonProxyHosts= so that 127.0.0.1 goes through it: the proxy relayed the command connection and the data one.
Le composant construit son propre contexte SSL à chaque exécution : truststore et keystore des propriétés javax.net.ssl.* (fichier et type) posées par un tSetKeystore, sinon les autorités de Java. Sans eux, un certificat autosigné donne javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed…, traitée selon Arrêter en cas d'erreur. Faire confiance à tous les serveurs accepte tout certificat.The component builds its own SSL context at each run: truststore and keystore of the javax.net.ssl.* properties (file and type) set by a tSetKeystore, otherwise the authorities of Java. Without them, a self-signed certificate gives javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed…, handled according to Die on error. Trust all servers accepts any certificate.
Le modèle désactive la vérification du nom du certificat, en toutes circonstances. Serveur dont le certificat est au nom de wrong.example.com, appelé sous 127.0.0.1, certificat dans le truststore : tFileFetch a téléchargé le fichier sans erreur, là où tHttpRequest et tREST l'ont refusé. Un certificat valide d'un autre site, présenté par un serveur qui usurpe l'adresse, serait accepté.The template disables the check of the certificate name, in all circumstances. Server whose certificate is in the name of wrong.example.com, called as 127.0.0.1, certificate in the truststore: tFileFetch downloaded the file with no error, where tHttpRequest and tREST rejected it. A valid certificate of another site, presented by a server that spoofs the address, would be accepted.
Arrêter en cas d'erreur cochée (défaut), l'erreur arrête le job avec le code 1, sauf lien On Component Error (le job s'est alors terminé avec le code 0). Décochée, le composant écrit sur la sortie d'erreur une ligne et la pile d'appels, puis deux lignes vides, et le job continue. With Die on error checked (default), the error stops the job with code 1, unless there is an On Component Error link (the job then ended with code 0). Unchecked, the component writes to the error output a line and the stack trace, then two empty lines, and the job goes on.
| CasCase | ERROR_MESSAGE | Case décochéeBox unchecked |
|---|---|---|
| HTTP, réponse 404 (ou toute réponse hors 2xx)HTTP, 404 response (or any response outside 2xx) | Method failed: HTTP/1.1 404 Not Found | Aucun fichier écritNo file written |
| HTTP, rien n'écoute sur le portHTTP, nothing listens on the port | Connect to 127.0.0.1:57555 [/127.0.0.1] failed: Connection refused: getsockopt | Aucun fichier écritNo file written |
| URI avec une espace, sans Encoder l'URIURI with a space, without Encode URI | Message URI is not correct or not encoded, please input a valid one or use 'Encode URI' option, puis NullPointerException : le job s'arrêteMessage URI is not correct or not encoded, please input a valid one or use 'Encode URI' option, then NullPointerException: the job stops | Arrêt quand mêmeStops anyway |
| FTP, fichier absentFTP, missing file | in/missing.csv (java.io.FileNotFoundException)in/missing.csv (java.io.FileNotFoundException) | Un fichier vide missing.csv (0 octet) est crééAn empty file missing.csv (0 bytes) is created |
| FTP, mot de passe refuséFTP, password rejected | Invalid username/password (sun.net.ftp.FtpLoginException) | Non essayéNot tried |
| HTTPS, mot de passe du truststore faux (tSetKeystore)HTTPS, wrong truststore password (tSetKeystore) | java.io.IOException: Keystore was tampered with, or password was incorrect | Arrêt quand même (code 1)Stops anyway (code 1) |
Avec un tJava relié par On Component Error (nom du job remplacé par MyJob, pile abrégée) :With a tJava connected by On Component Error (job name replaced with MyJob, shortened stack):
Exception in component tFileFetch_1 (MyJob) java.lang.Exception: Method failed: HTTP/1.1 404 Not Found at demo.myjob_0_1.MyJob.tFileFetch_1Process(MyJob.java:481) … On Component Error: ERROR_MESSAGE=Method failed: HTTP/1.1 404 Not Found
There is an exception on: ftp://demo:demo@127.0.0.1:54531/in/missing.csv java.io.FileNotFoundException: in/missing.csv … missing.csv (0 bytes)
La dernière ligne vient du tJava qui suit : le fichier vide est bien là. L'URI, compte FTP compris, est écrite dans la console.The last line comes from the tJava that follows: the empty file is there. The URI, FTP account included, is written to the console.
| VariableVariable | Type | Description |
|---|---|---|
INPUT_STREAM | java.io.InputStream | Flux d'entrée : le contenu reçu, avec Utiliser le cache ; nul sinon.Input stream: the content received, with Use cache; null otherwise. |
ERROR_MESSAGE | String | Message de la dernière erreur. Non déclarée par le composant (absente de la complétion), mais posée par le modèle.Message of the last error. Not declared by the component (missing from the completion), but set by the template. |
(java.io.InputStream) globalMap.get("tFileFetch_1_INPUT_STREAM")
((String) globalMap.get("tFileFetch_1_ERROR_MESSAGE"))
Le composant ne donne ni le code de la réponse ni le chemin du fichier écrit : construisez ce dernier vous-même à partir du dossier et du nom. The component gives neither the code of the response nor the path of the written file: build the latter yourself from the folder and the name.
Un tFileFetch déposé envoie un POST vide. Décochez Méthode POST pour télécharger.A dropped tFileFetch sends an empty POST. Uncheck POST method to download.
Le nom déduit de l'URI vaut defaultfilename.txt pour un fichier à la racine, une adresse qui finit par / ou une requête (?…) sous Windows ; deux téléchargements écrasent alors le même fichier.The name deduced from the URI is defaultfilename.txt for a file at the root, an address ending with / or a query (?…) on Windows; two downloads then overwrite the same file.
Délai avant expiration ne limite que l'ouverture de la connexion. Avec 1000 (1 s), une réponse arrivée au bout de 4 s a été attendue et enregistrée (Slow response after 4 s). Un serveur qui accepte la connexion sans répondre bloque le job.Timeout only limits the opening of the connection. With 1000 (1 s), a response that came after 4 s was waited for and saved (Slow response after 4 s). A server that accepts the connection without answering blocks the job.
Case Arrêter en cas d'erreur décochée, l'erreur HTTP s'annonce par There isContinue_tFileFetch_1 an exception on: … : le nom d'une variable du modèle s'est glissé dans le texte (défaut de Talaxie 9.0.6). En FTP, le message est correct.With Die on error unchecked, the HTTP error is announced by There isContinue_tFileFetch_1 an exception on: …: the name of a variable of the template slipped into the text (defect of Talaxie 9.0.6). In FTP, the message is correct.
En FTP, case décochée, un fichier absent du serveur laisse un fichier vide dans le dossier de destination. Testez ERROR_MESSAGE ou la taille du fichier avant de le traiter.In FTP, with the box unchecked, a file missing from the server leaves an empty file in the destination folder. Test ERROR_MESSAGE or the size of the file before processing it.
Le mot de passe FTP fait partie de l'URI : il est dans le code du job et dans les messages d'erreur. Passez-le par une variable de contexte ("ftp://" + context.ftpUser + ":" + context.ftpPassword + "@…"), ou préférez tFTPGet, qui a un champ mot de passe et le FTPS.The FTP password is part of the URI: it is in the code of the job and in the error messages. Pass it through a context variable ("ftp://" + context.ftpUser + ":" + context.ftpPassword + "@…"), or prefer tFTPGet, which has a password field and FTPS.
tFTPGet · plusieurs fichiers par FTP, SFTP, FTPSseveral files over FTP, SFTP, FTPStHttpRequest · requête HTTP, réponse dans le fluxHTTP request, response in the flowtFileInputDelimited · lire le fichier ou le flux reçuread the file or the stream receivedtSetKeystore · certificats pour HTTPScertificates for HTTPStFileList · parcourir les fichiers téléchargésgo through the downloaded filestFileUnarchive · décompresser une archive téléchargéeunpack a downloaded archive