Open Anypoint Studio
Create a File New Mule Project
Expand the «myfirstproject» on package explorer
Double click on myfirstproject.xml
Once file is open, show Message Flow
From Mule Palette view, search for ‘File’ ,‘File To String’ ,‘Logger’ and select the first one.
Drag and Drop HTTP then Java component into Message Flow view.
Now we have to configure the File component for our HTTP flow.
Double click on it and set a path in a local folder then create a txt file outside the folder.
Click OK and SAVE
Configure the Logger component to print out the flow message about the file we are transferring (show on Console).
File-To-String element configures a transformer that reads the content of java.io.File into a java.lang.String.
Actually we don’t have to give it a custom configuration.
Click on SAVE at top-left of screen
Now we can start our Mule server
Right Click on project Run As
On the Console view below server
is going to start.
At the end you will see the status
This means that server is up and
Now we can see the result:
drop the txt file we created into
the folder and look at the console
The flow works!