file connector with base64 decoder and other "improvements"
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

wso2 esb file connector

Based on original fileconnector-1.0.0:

Difference between original and this version:

  • decode base64 strings before saving file
  • get file name while reading directory

Decode base64 on save:

this file connector allow's you to decode base64 strings before saving file. For example: you got binary\text or whatever file and you send this file, with or without MTOM or SwA, on WSO2ESB. In ESB logs you will see something like:

<soapenv:Envelope xmlns:soapenv="" xmlns:ns0="">

and you wanna store this content as decoded base64 file:

$ cat myHelloWord.txt
Hello world!!!

instead of encoded base64:

$ cat myHelloWord.txt

with this file connector, this is quite simple, only thing that you need to set encoding property in <fileconnector.create> section to base64, default values like US-ASCII, UTF-8, UTF-16 is still supporting:

<property name="encoding" value="base64"></property>

Get file name on

Let's say you got bunch of files in one directory and you need read them:

├── test.xml
├── test9.xml
├── testOne.xml
└── testTwo.xml

in proxy sequence you have this:


after reading, file name will be stored in property FILE_NAME_CTX. it can be easy obtained by expression $ctx:FILE_NAME_CTX or get-property('FILE_NAME_CTX'). For example:

<log level="full">
  <property name="filename" expression="$ctx:FILE_NAME_CTX"/>

meanwhile in logs

[2015-12-15 23:36:54,117]  INFO - LogMediator To: /services/readFileWithName, MessageID: urn:uuid:0c9d0d78-1177-45a0-9033-6e2c3f7d4198, Direction: request, filename = file:///Z:/test_files/test.xml, Envelope: 

Build pre-requisites:

  • Maven 3.x
  • Java 1.7 or above

Tested Platform:

  • UBUNTU 13.10, Mac OSx 10., Ubuntu 15.10
  • WSO2 ESB 4.9.0-ALPHA, WSO2 ESB 4.8.1
  • Java 1.7, OpenJDK 7

pre-requisites for integration tests for WSO2 ESB File Connector:


  1. Download ESB 4.9.0-ALPHA by navigating the following the URL:

  2. Copy the in to location "{ESB_Connector_Home}/repository/".

  3. Please do these changes on fileconnector.xml (fileconenctor.xml file can be found from /src/test/resources/artifacts/ESB/config/proxies/fileconnector/).

    1. Change the file locations with the accessible file locations.

    2. Copy an 'mp4' or a large file at the location specified in <fileconnector.copylarge></fileconnector.copylarge> for copylarge method.

    3. Create a file at the location specified in <fileconnector.copy></fileconnector.copy> for copy method.

    4. Create at least one folder and a file at the location specified in <filelocation></filelocation> archive method.

  4. Make sure that fileconnector is specified as a module in ESB_Connector_Parent pom.

  5. Navigate to "{ESB_Connector_Home}/" and run the following command.

      $ mvn clean install


licensed according to the terms of Apache License, Version 2. ( )