title: WSO2 ESB 4.5.0 vfs TransportSender as Endpoint Errors with 'Access is denied'
body: <p>I am trying to put together a proof of concept for the use of wso2 esb. The proof of concept will rely on the ESB picking up a csv file dropped into a folder, converting the details to xml, posting them to a 3rd party web service, then converting the response, which should contain the binary for a pdf, into a pdf and dropping it into a folder. </p>
  
  <p>The current problem with this is that when I configure a folder as an endpoint in wso2 esb 4.5.0, any file that I send to that end-point errors. A stripped down version of my configuration is as defined below: - </p>
  
  <pre><code>&lt;proxy name="PDFPoller"
        transports="vfs"
        startOnLoad="true"
        trace="enable"
        statistics="enable"&gt;
    &lt;description/&gt;
    &lt;target&gt;
       &lt;inSequence&gt;
          &lt;log level="custom"&gt;
             &lt;property name="status" value="PDF Receieved"/&gt;
          &lt;/log&gt;
          &lt;log level="full"/&gt;
          &lt;property name="transport.vfs.ReplyFileName"
                    expression="test1.pdf"
                    scope="transport"/&gt;
          &lt;property name="OUT_ONLY" value="true"/&gt;
          &lt;send&gt;
             &lt;endpoint name="FileEpr"&gt;
                &lt;address uri="vfs:file:///c:/wso2/processed"/&gt;
             &lt;/endpoint&gt;
          &lt;/send&gt;
       &lt;/inSequence&gt;
    &lt;/target&gt;
    &lt;parameter name="transport.vfs.ActionAfterProcess"&gt;MOVE&lt;/parameter&gt;
    &lt;parameter name="transport.PollInterval"&gt;15&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.MoveAfterProcess"&gt;file:///C:/wso2/output&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.FileURI"&gt;file:///C:/wso2/PollFolder&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.MoveAfterFailure"&gt;file:///C:/wso2/Failed&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.FileNamePattern"&gt;.*.pdf&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.ContentType"&gt;application/pdf&lt;/parameter&gt;
    &lt;parameter name="transport.vfs.ActionAfterFailure"&gt;MOVE&lt;/parameter&gt;
  </code></pre>
  
  <p></p>
  
  <p>The error that I get from the ESB is as follows: - </p>
  
  <pre><code>2012-10-29 09:46:00,642 [-] [Axis2 Task] ERROR VFSTransportSender IO Error while 
  org.apache.commons.vfs2.FileSystemException: Could not write to "file:///c:/wso2/processed".
      at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream(AbstractFileObject.java:1440)
      at org.apache.commons.vfs2.provider.DefaultFileContent.getOutputStream(DefaultFileContent.java:462)
      at org.apache.synapse.transport.vfs.VFSTransportSender.populateResponseFile(VFSTransportSender.java:232)
      at org.apache.synapse.transport.vfs.VFSTransportSender.sendMessage(VFSTransportSender.java:173)
      at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
      at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:627)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  Caused by: java.io.FileNotFoundException: c:\wso2\processed (Access is denied)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:194)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:116)
      at org.apache.commons.vfs2.provider.local.LocalFile.doGetOutputStream(LocalFile.java:220)
      at org.apache.commons.vfs2.provider.AbstractFileObject.getOutputStream(AbstractFileObject.java:1432)
      ... 8 more
  </code></pre>
  
  <p>I don't believe that the problem is a local folder permissions problem, because I have a) checked the permissions on the folder manually and b) The ESB will move the file that I place in the 'pollfolder' to either 'Output' or 'Processed' if I set the transport.vfs.MoveAfterProcess property to that value, so it is possible to write to both these folders.</p>
  
  <p>Any help would be appreciated. </p>