<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to implement GenericFileProcessStrategy in Talend route? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339431#M107573</link>
    <description>Thanks for your help, Gliu. It works perfectly!!! So, now, I can do almost everything 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;To complete Gliu's answer, here is the list of imports you have to add in the class to get it work properly: 
&lt;BR /&gt; 
&lt;PRE&gt;import java.io.File;&lt;BR /&gt;import org.apache.camel.Exchange;&lt;BR /&gt;import org.apache.camel.component.file.GenericFile;&lt;BR /&gt;import org.apache.camel.component.file.GenericFileEndpoint;&lt;BR /&gt;import org.apache.camel.component.file.GenericFileOperations;&lt;BR /&gt;import org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 May 2013 11:00:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-05-24T11:00:09Z</dc:date>
    <item>
      <title>How to implement GenericFileProcessStrategy in Talend route?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339429#M107571</link>
      <description>Hello all of you, 
&lt;BR /&gt;In one of my Talend Route, I have to wait for certain criterias (such as the number, names and types of files) before starting consuming all the files stored in my directory. 
&lt;BR /&gt;I saw it was possible to customize the file process strategy in Camel File Component (Cf. "processStrategy" option), what is, I assume, exactly what I should do to achieve my goal. 
&lt;BR /&gt;The only problem is I don't know how to implement this class (in the beans?), and how to declare it and use it in my route. I've tried to search the documentation and the web for some examples or tutos, but didn't find. Has anyone done this before, or know where I could find some help? 
&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Thu, 23 May 2013 09:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339429#M107571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-23T09:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement GenericFileProcessStrategy in Talend route?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339430#M107572</link>
      <description>Yes, you can provide the class in beans, for example, if you don't want to process the file if it names as &lt;B&gt;a.txt&lt;/B&gt;, you can create a Bean in Beans like below:&lt;BR /&gt;&lt;PRE&gt;public class CustomFileProcessStrategy extends GenericFileProcessStrategySupport&amp;lt;File&amp;gt;{&lt;BR /&gt;	@Override&lt;BR /&gt;	public boolean begin(GenericFileOperations&amp;lt;File&amp;gt; operations,&lt;BR /&gt;			GenericFileEndpoint&amp;lt;File&amp;gt; endpoint, Exchange exchange,&lt;BR /&gt;			GenericFile&amp;lt;File&amp;gt; file) throws Exception {&lt;BR /&gt;		boolean begin = super.begin(operations, endpoint, exchange, file);&lt;BR /&gt;		if(!begin){&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;		File realFile = file.getFile();&lt;BR /&gt;		if(realFile == null || !realFile.exists()){&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;		if("a.txt".equals(realFile.getName())){&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;		return true;&lt;BR /&gt;		&lt;BR /&gt;	}&lt;BR /&gt;}&lt;/PRE&gt;&lt;BR /&gt;Then according to you studio version:&lt;BR /&gt;Before V5.3, you can do it as below:&lt;BR /&gt;1.  Create a &lt;B&gt;cBeanRegister&lt;/B&gt; component, specify the id as &lt;B&gt;fileStrategy&lt;/B&gt;, specify the &lt;B&gt;Class Name&lt;/B&gt; as &lt;B&gt;beans.CustomFileProcessStrategy&lt;/B&gt;&lt;BR /&gt;2.  On &lt;B&gt;cFile&lt;/B&gt; component, specify the &lt;B&gt;Path&lt;/B&gt; on &lt;B&gt;Basic settings&lt;/B&gt;, and specify the &lt;B&gt;processStrategy&lt;/B&gt; with value &lt;B&gt;#fileStrategy&lt;/B&gt; on &lt;B&gt;Advanced settings&lt;/B&gt;&lt;BR /&gt;That's it.&lt;BR /&gt;On V5.3, you can replace &lt;B&gt;cBeanRegister&lt;/B&gt; by using spring configuration, add below bean definition into Spring configuration:&lt;BR /&gt;&lt;PRE&gt;&amp;lt;bean class="beans.CustomFileProcessStrategy" id="fileStrategy" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;That's it.</description>
      <pubDate>Fri, 24 May 2013 08:18:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339430#M107572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-24T08:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement GenericFileProcessStrategy in Talend route?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339431#M107573</link>
      <description>Thanks for your help, Gliu. It works perfectly!!! So, now, I can do almost everything 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;To complete Gliu's answer, here is the list of imports you have to add in the class to get it work properly: 
&lt;BR /&gt; 
&lt;PRE&gt;import java.io.File;&lt;BR /&gt;import org.apache.camel.Exchange;&lt;BR /&gt;import org.apache.camel.component.file.GenericFile;&lt;BR /&gt;import org.apache.camel.component.file.GenericFileEndpoint;&lt;BR /&gt;import org.apache.camel.component.file.GenericFileOperations;&lt;BR /&gt;import org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2013 11:00:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339431#M107573</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-24T11:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement GenericFileProcessStrategy in Talend route?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339432#M107574</link>
      <description>When trying with 'Customized' java code in cbeanRegister component, getting "beans.FtpFileFilter cannot be resolved" error .Below is My 'Customized' java code :&lt;BR /&gt;"beanInstance = new beans.FtpFileFilter(context.filecontains);"&lt;BR /&gt;Could you please help me on this issue ? &lt;BR /&gt;How to use the Customized java code to create beanInstance in cbeanRegister component?</description>
      <pubDate>Wed, 23 Apr 2014 10:48:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-implement-GenericFileProcessStrategy-in-Talend-route/m-p/2339432#M107574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-04-23T10:48:01Z</dc:date>
    </item>
  </channel>
</rss>

