One Star

[resolved] TFileExist

Hi,
We wanted to set a filename into a TFileExist component and we don't know how to do it:
We've try that: context.rep_local+"ANATTAET.*.txt"
We've try that: context.rep_local+"ANATTAET*.txt"
And that did'nt work. The filename change all the time and we cannot specify a specific filename (unfortunatly)
Thx for your help
1 ACCEPTED SOLUTION

Accepted Solutions

Re: [resolved] TFileExist

- Use an "Interate Row" to connect tFileList_1 and tFileExist_1 (since you gave a wildcard expression in Filemask setting for tFileList_1)
- make sure that the setting for Directory in tFileExist_1 is a valid Directory
9 REPLIES

Re: [resolved] TFileExist

Hi,
you could try to set the following  context.path +    Numeric.random(0,100)  + ".txt" .
In the File components guide at :
you'll find an example (worth reading Smiley Wink):
Scenario: Checking for the presence of a file and creating it if it does not exist
BR Marcus
One Star

Re: [resolved] TFileExist

The files always begin by ANATTAET and I don't find the correct syntax in the component guide

Re: [resolved] TFileExist

Please describe the context for using the tFileExist in your Job.
One Star

Re: [resolved] TFileExist

 
Hi,
We want to check if a file exist with an if ((Boolean)globalMap.get("tFileExist_1_EXISTS")) before to put it on FTP Server
Five Stars

Re: [resolved] TFileExist

It seems you are using wrong file name format. the way you specified it will not work with this component, 
you can better use tFileList FTP then compare file list with source files. 

Re: [resolved] TFileExist

Assuming you use a tFileList component ... add a Filemask like "ANATTAET*.txt"
and then in your tFileExist component use ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) as your File name/Stream
One Star

Re: [resolved] TFileExist

  
Thank you for your answer but when I tried I get the following error:
Démarrage du job FtpCheck_by_RC a 16:44 04/12/2014.
connecting to socket on port 3566
connected
Exception in component tFileExist_1
java.lang.NullPointerException
    at java.io.File.<init>(File.java:277)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.tFileExist_1Process(FtpCheck_by_RC.java:1866)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.tFileList_1Process(FtpCheck_by_RC.java:1782)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.tServerAlive_1Process(FtpCheck_by_RC.java:803)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.runJobInTOS(FtpCheck_by_RC.java:5935)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.main(FtpCheck_by_RC.java:5791)
disconnected
Job FtpCheck_by_RC terminé à 16:44 04/12/2014.

Re: [resolved] TFileExist

- Use an "Interate Row" to connect tFileList_1 and tFileExist_1 (since you gave a wildcard expression in Filemask setting for tFileList_1)
- make sure that the setting for Directory in tFileExist_1 is a valid Directory
One Star

Re: [resolved] TFileExist

OK I think I found a way
Again thank you for your help, good evening