Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a scenario where I have to check on ftp directory,and if its empty trigger an email. I've tried using component tftpfile_exist with
if condition - !((Boolean)globalMap.get("tFileExist_1_EXISTS")) but on running the job it returns
Exception in component tFTPFileExist_1 (dummy)
java.lang.NullPointerException
at demo.dummy_0_1.dummy.tFTPFileExist_1Process(dummy.java:404)
at demo.dummy_0_1.dummy.runJobInTOS(dummy.java:895)
at demo.dummy_0_1.dummy.main(dummy.java:745)
I've tried using tftp_list too but same error occurs.
Thanks in advance
Hi shong,
I've been using tftpfile_exist with standard parametres, no variables have been involved.
Here's the screenshot for your reference.
Regards,
Hi Shong,
Thanks for the quick reply, the nullpointer issue got solve when I replace tFileExist in "if" condition with tFTPfile_Exist but It seems the tFtpfILE_EXIST Component just checks whether the directory exists or not,but in my scenario I have to check whether the list of 20 files exist on that particular directory or not.If count is less than 20 it should trigger the mail. Can you please help me with the arrangement of components required to meet my scenario.
Thanks in Advance.
tFTPFileExist check if the specified directory or file exists or not. If you just need to check if the number of files in the particular directory, you can use tFTPFileList, there is a global variables NB_LINE that counts the total number of files found in the directory, you can use this global variable in the runIf expression, eg
((Integer)globalMap.get("tFTPFileList_1_NB_FILE"))<20