You are not logged in.
Announcement
Unanswered posts
|
....
work fine with tFlowToIterate !!
I was looking "midi à 14 heures" or "to make a mountain out of a mole hill" at the end !
result
not exist so do something else ...
not exist so do something else ...
not exist so do something else ...
not exist so do something else ...
exist so do something ...
thanks a lot ...
thanks to both of you,
files are in fact attachment part mail . I rename the file due to getFrom javamail's method and associated name
Sometimes partners change those values without telling us .In those case file keep the real "getfrom value" for naming file , but I don't know by advance which one.
I want to keep jobs and applications still running 'til the end for "the good ones" and take "the wrong ones" out of the flow!
So I can look after filename that I know with tFileList (with pattern) and copy them somewhere else ... and it's why the reason for "else"
Perhaps parse twice the file list , first with pattern that I know, and another time with a pattern like "*.unknown" wherein "unknown" is the extension that i've added to unrecognized partners (getfrom value) !
laurent
ps : in the generated code there is
java.io.File file_tFileExist_1 = new java.io.File(
"/home/raulier/TALEND_TEST/"
+ ((String) globalMap
.get("tFileList_1_CURRENT_FILE")));
if (!file_tFileExist_1.exists()) {
globalMap.put("tFileExist_1_EXISTS", false);
} else {
globalMap.put("tFileExist_1_EXISTS", true);
}so boolean value exist for my "if ...else" solution , isnt' it ?
nevermind , i'm going to test your solution bcourtine ...
I think it's normal : the tFileList components reads the real content of your folder. So only existing files matching the filemask will send be in the flow.
For your purpose you should replace your tFileList component by a tFileInputDelimited (containing a list of absolute paths) and next a tFlowToIterate.
Hello
ps.odt doesn't exist !!)
As you said, the file doesn't exist, so the tFileList will not pass the file path of ps.odt to tFileExist, that means tFileExist don't check this file.
Best regards
shong
hi,
I have to check if some files exist ...
If file exist do something
if not (else) do something !
But flow 's never gone in "else" . (ps.odt doesn't exist !!)
conition I use :
if
((Boolean)globalMap.get("tFileExist_1_EXISTS"))else
!((Boolean)globalMap.get("tFileExist_1_EXISTS"))looks so simple , but didn't found solution !
thanks