cancel
Showing results for 
Search instead for 
Did you mean: 

Queries on File Adapter

0 Kudos

Hi Gurus,

I have few queries on File channel, Is it possible to check the directory before we fill the target directory through the file adapter. for example :

there is target directory D:/File Input, if this directory contains any documents, subsequently file adapter should not push any documents. how can we achieve this. please suggest me. thanks in advance .

Regards

Raja

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186851
Active Contributor
0 Kudos

Hello Raj,

You can try configuring the Source file name with extenstions.

For example to pick .txt files and to restrict .PDF files.

If you configure as *.txt only txt files will picked ignoring PDF files.

0 Kudos

thanks for your response,

I am trying to process the same extension of files (txt) ...

regards

raja

former_member182412
Active Contributor
0 Kudos

Hi Rajavadivel,

You cannot do this in receiver file adapter to check the files exist in target directory and stop processing if there is any files in target directory, you can do control this in sender side by using start and stop the channel externally (The sender channel should be external control), sender application before sending to PI you can check the directory is there any files exist in the target directory or not, if the files there don't send the data, if there is files in the target directory then you can start the sender communication channel externally After sending the data you must stop the channel again.


Regards,

Praveen.

0 Kudos

thanks for your response

former_member186851
Active Contributor
0 Kudos

Raj,

So you wish to restrict some .txt files getting processed?

0 Kudos

yeah Raghu ... do we have any option as i aware we can do some restriction in sender channel. but not sure about receiver channel. keep me posted if you have any clue.

thanks

raja

former_member186851
Active Contributor
0 Kudos

Hello Raj,

You can use Exclusion mask option.

But can you tell me how your differentiating the files ,Is it with some name?

0 Kudos

HI Raghu,

yeah it will be the same name without time-stamp. whenever the directory contains any files with the same name. then target file channel should not push the file, until the previous old file is processed from target directory.

regards

raja

former_member186851
Active Contributor
0 Kudos

Hello Raj,

If the difference in the filenames then you can try as per the below link

And for duplicate file handling refer the below link

former_member182412
Active Contributor
0 Kudos

Hi Rajavadivel,

You can do this by disable the check box Overwrite Existing File option in the receiver channel of section Processing parameters. Then if the same file ABC.txt exist in the directory then PI will not write the same file again to the directory, the message will fail with error saying the file is already exist cannot be overwritten, once the file has been removed from the directory then PI will write this file to the directory. You need to enable both send and receiver side adapter specific message attributes and select the File Name attribute.

Regards,

Praveen.