History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: MULE-3198
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Daniel Feist
Reporter: Daniel Feist
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Mule

Unable to use java.io.File payload with file transport

Created: 08/Apr/08 10:15 AM   Updated: 10/Apr/08 01:24 PM
Component/s: Transport: File
Affects Version/s: 2.0.0
Fix Version/s: 2.0.1

Time Tracking:
Not Specified

File Attachments: 1. Java Source File FileObjectMessageAdapter.java (2 kb)
2. Java Source File FileObjectMessageAdapterTestCase.java (2 kb)

Issue Links:
Related
 

Labels:
User impact: Medium


 Description  « Hide
When using streaming FileMessageAdaptor with a FileInputStream payload is used by default.

When not using streaming FileContentsMessageAdaptor is used with a byte[] payload is used by default.

Since work on the file transport to make streaming work correctly it is no longer possible to pass a java.io.File payload.

We either need to:
i) Create a 3rd message adaptor for this case (which I suppose would only be used when overriding defaults)
ii) Make the FileMessageAdaptor a bit more intelligent so if it is created with a File getPayload() returns a file, and it is was created with a FileInputStream it returns a FileInputStream when getPayload() is called.



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
M. Demolsky - 09/Apr/08 07:50 AM
<file:connector name="myFileConnector" autoDelete="false" streaming="false" pollingFrequency="1000" moveToDirectory="./test-data/out">
<service-overrides messageAdapter="org.mule.transport.file.FileObjectMessageAdapter"/>
</file:connector>

I've attached a new message adapter (incl. test case) which returns as payload the file object.

regards
markus


Daniel Feist - 10/Apr/08 01:24 PM
Rather than implement a new MessageAdaptor for java.io.File I fixed the bug with the existing dual-purpose FileMessageAdaptor.

This means that things will work in 2.0 as documented for 1.4. Also if a user does not want to use the default FileContentsMessageAdaptor when streaming is off they can just use the FileMessageAdaptor rather than having to know about another FileObjectMessageAdaptor.

Thanks for the patch anyway...

http://svn.mule.codehaus.org/changelog/mule/?cs=11559