title: Spring Integration - file adapter
body: <p>I'm newbie to Spring, I am writing a file adapter which reads file from the input folder and move the files to output folder. I played with the following examples but there are some points that are not clear to me.    </p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:integration="http://www.springframework.org/schema/integration"
  xmlns:file="http://www.springframework.org/schema/integration/file"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/integration
          http://www.springframework.org/schema/integration/spring-integration.xsd
          http://www.springframework.org/schema/integration/file
          http://www.springframework.org/schema/integration/file/spring-integration-file.xsd"&gt;
  
  &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
  
  &lt;file:inbound-channel-adapter id="filesIn"
                                directory="C:\Users\my\Desktop\files\in"
                                filename-regex="[a-z]+.txt"&gt;
      &lt;integration:poller id="poller" fixed-delay="5000"/&gt;
  &lt;/file:inbound-channel-adapter&gt;
  
  &lt;file:file-to-string-transformer input-channel="filesIn" output-channel="strings"/&gt;
  
  &lt;integration:channel id="strings"/&gt; 
  
  &lt;integration:service-activator input-channel="strings"
                                 output-channel="filesOut"
                                 ref="handler"/&gt;
  
  &lt;file:outbound-channel-adapter id="filesOut" directory="C:\Users\my\Desktop\files\out"/&gt;
  
  &lt;bean id="handler" class="org.springframework.integration.samples.filecopy.Handler"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have few more questions regarding the above file.</p>
  
  <ol>
  <li>I don't have a clear idea about the <code>&lt;integration:channel id="strings"/&gt;</code> tag. Why its just string. What are the other possible values which can be used instead <code>strings</code>.   </li>
  <li>As I tested <code>input-channel</code> of the <code>integration:service-activator</code> and <code>output-channel</code> of the <code>file-to-string-transformer</code> has nothing to do with <code>&lt;integration:channel id="strings"/&gt;</code> is it correct?</li>
  <li><p><code>handler</code> bean which is used in <code>integration:service-activator</code> has 3 methods.</p>
  
  <pre><code>public class Handler {
  
  public String handleString(String input) {
      System.out.println("Copying text: " + input);
      return input.toUpperCase();
  }
  
  public File handleFile(File input) {
      System.out.println("Copying file: " + input.getAbsolutePath());
      return input;
  }
  
  public byte[] handleBytes(byte[] input) {
      System.out.println("Copying " + input.length + " bytes ...");
      return new String(input).toUpperCase().getBytes();
  } }
  </code></pre>
  
  <p>And currently it fires only one method which is <code>handleString(String whichTakesString)</code> is it because of the <code>&lt;integration:service-activator input-channel="strings"</code> ? How can I call the other methods, what is the way to do it. I tried to figure this out many ways but still no chance.</p></li>
  </ol>