One Star jmd
One Star

tFTPFileList : how to know an entry is a directory

Hi,
I use a tFTPFileList to get files from a FTP server
But there is a subdirectory in the directory listed
=> this subdirectory is considered as a file and generates an error when the job tries to work with this folder as if it was a file
Do you know how to test the type of the element brought by the tFTPFile List ?
Thanks in advance
16 REPLIES
One Star

Re: tFTPFileList : how to know an entry is a directory

Hi,
To avoid this problem, I propose you to add a mask like "*.gz" for example in your tFTPFileList file mask area Smiley Happy

Best regards,
Stéphane
One Star jmd
One Star

Re: tFTPFileList : how to know an entry is a directory

Thanks but it's not possible as the files to list don't have any extension
One Star

Re: tFTPFileList : how to know an entry is a directory

I used the component tFTPFileList with the mask "*.*" and it worked for me : the component lists all files with extension, but no directory.
Best Regards,
Stéphane
Edit : Sorry, my files have extension, but not yours! This post didn't answer correctly to your question!
Moderator

Re: tFTPFileList : how to know an entry is a directory

Hi jmd,
Uncheck the option 'File details', it will not list the directories, but only files. For more information, please read the component online manual
https://help.talend.com/search/all?query=tFTPFileList]tFTPFileList&content-lang=en
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star jmd
One Star

Re: tFTPFileList : how to know an entry is a directory

I tried that but "File details" option completely changed the values returned in the ((String)globalMap.get("tFTPFileList_1_CURRENT_FILE")) variable returned by the component and it can't be treated correctly (date & time of the file is added in the name of the file)
Community Manager

Re: tFTPFileList : how to know an entry is a directory

I tried that but "File details" option completely changed the values returned in the ((String)globalMap.get("tFTPFileList_1_CURRENT_FILE")) variable returned by the component and it can't be treated correctly (date & time of the file is added in the name of the file)

Sabrina meant to unselect the 'File details' option.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star jmd
One Star

Re: tFTPFileList : how to know an entry is a directory

it's unchecked by default and it still returns directory entries
Community Manager

Re: tFTPFileList : how to know an entry is a directory

Hi
Which version are you using? I tested this issue on v5.2.1 and it don't returns directory entries.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star jmd
One Star

Re: tFTPFileList : how to know an entry is a directory

5.2.0
I don't think there is a difference in 5.2.1
Community Manager

Re: tFTPFileList : how to know an entry is a directory

Hi jmd
I can't reproduce the problem on v5.2.0, if i uncheck the 'file details' option, it will only list the files, do not list directories. Please see my screenshots.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star jmd
One Star

Re: tFTPFileList : how to know an entry is a directory

But in your example, you don't have files WITHOUT EXTENSION
Try that
One other detail : the FTP server is on a Windows server
Community Manager

Re: tFTPFileList : how to know an entry is a directory

Hi
What's type of your file? It is possible for you email me an example file for testing?
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star jmd
One Star

Re: tFTPFileList : how to know an entry is a directory

It's a text file, no matter what's inside, but it doesn't have an extension
Community Manager

Re: tFTPFileList : how to know an entry is a directory

It's a text file, no matter what's inside, but it doesn't have an extension

I also tested the files without extension, and it works. jmd, you are using Talend Enterprise product, can you please report a ticket on our support portal, our colleague from support team will assist you further, schedule a webex meeting and investigate the problem together if needed.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star jmd
One Star

Re: tFTPFileList : how to know an entry is a directory

Hi,
I have different customers, someone use the enterprise product, and in this case, I wouldn't spend my time on the forum, I would have sent a case to the support
But for this problem, the customer use the open version, so I can't use the support ...
One Star

Re: tFTPFileList : how to know an entry is a directory

It seems that if i check "SFTP support" and check "File Details", TOS_DI 5.2.2(r99271) does not show the details of the file. I have used Shong's scheme:
tFTPFilelist ----> tJava
I have tried without SFTP support and it works normally.
Any help?
Thanks in advance