Re: [Dev] File read with enabling streaming

2016-11-24 Thread Vivekananthan Sivanayagam
Hi Malaka,

I am getting the casting exception in the following methods in the
carbon-mediation[1].

private void findAndWrite2OutputStream(MessageContext messageContext,
   OutputStream out,
   boolean preserve) throws
AxisFault {
try {
SOAPEnvelope envelope = messageContext.getEnvelope();
  OMElement contentEle = envelope.getBody().getFirstElement();
if (contentEle != null) {
OMNode node = contentEle.getFirstOMChild();
if (!(node instanceof OMText)) {
String msg = "Wrong Input for the Validator, " +
"the content of the first child element of the
Body " +
"should have the zip file";
log.error(msg);
throw new AxisFault(msg);
}
OMText binaryDataNode = (OMText) node;
DataHandler dh = (DataHandler)
binaryDataNode.getDataHandler();

DataSource dataSource = dh.getDataSource();
if (((StreamingOnRequestDataSource)
dataSource).isConsumed()) {
Object httpMethodObj =
messageContext.getProperty(Constants.Configuration.HTTP_METHOD);
if ((httpMethodObj instanceof String) &&
"POST".equals(httpMethodObj)) {
log.warn("Attempting to send an already
consumed request [" +
 messageContext.getTo().getAddress() +
" POST/Empty Message Body]");
}
}

//Ask the data source to stream, if it has not already
cached the request
if (!preserve && dataSource instanceof
StreamingOnRequestDataSource) {
((StreamingOnRequestDataSource)
dataSource).setLastUse(true);
}

dh.writeTo(out);
}
} catch (OMException e) {
log.error(e);
throw AxisFault.makeFault(e);
} catch (IOException e) {
log.error(e);
throw AxisFault.makeFault(e);
}
}


[1]
https://github.com/wso2/carbon-mediation/blob/master/components/mediation-monitor/message-relay/org.wso2.carbon.relay/src/main/java/org/wso2/carbon/relay/ExpandingMessageFormatter.java#L185

Vivekananthan Sivanayagam
Associate Software Engineer | WSO2
E:vivekanant...@wso2.com
M:+94752786138

On Thu, Nov 24, 2016 at 4:30 PM, Malaka Silva  wrote:

>
>
> On Thu, Nov 24, 2016 at 4:25 PM, Vivekananthan Sivanayagam <
> vivekanant...@wso2.com> wrote:
>
>> Hi Malaka,
>>
>> When I enable builders as I mentioned in the previous mail, It is working
>> always for the false statement[1] of streaming even enabling the streaming.
>> We have to use "> class="org.apache.axis2.format.BinaryBuilder"/>", If I use this one, I
>> am getting
>> "PassThroughHttpSender Failed to submit the response" error.
>>
> ​We have to dig into this and find the root cause.​
>
>
>>
>> We were able to write the file content into the message context but could
>> not get this as a response, and I checked the test case and found the
>> reason why it worked, there streaming is set as true and content type is
>> as "text/plain", in this case also consider as an else statement, that is
>> why test cases are passed.
>>
> ​Currently latest connector read does not work. So ideally the test case
> should fail.​
>
>
>>
>> [1]
>>
>> ​
>> ​
>> InputStream in;
>>
>> if (builder instanceof DataSourceMessageBuilder && "true".equals(streaming)) 
>> {
>> in = null;
>> dataSource = ManagedDataSourceFactory.create(new 
>> FileObjectDataSource(file, contentType));
>> } else {
>> in = new AutoCloseInputStream(file.getContent().getInputStream());
>> dataSource = null;
>> }
>>
>>
>> Vivekananthan Sivanayagam
>> Associate Software Engineer | WSO2
>> E:vivekanant...@wso2.com
>> M:+94752786138
>>
>> On Thu, Nov 24, 2016 at 10:23 AM, Vivekananthan Sivanayagam <
>> vivekanant...@wso2.com> wrote:
>>
>>> Hi Malaka,
>>>
>>> When I use ">> class="org.wso2.carbon.relay.BinaryRelayBuilder"/>" instead of
>>> ">> class="org.apache.axis2.format.BinaryBuilder"/>", it is working fine.
>>>
>>> Vivekananthan Sivanayagam
>>> Associate Software Engineer | WSO2
>>> E:vivekanant...@wso2.com
>>> M:+94752786138
>>>
>>> On Wed, Nov 23, 2016 at 3:26 PM, Vivekananthan Sivanayagam <
>>> vivekanant...@wso2.com> wrote:
>>>
 Hi Makala,

 I tried the given config and getting the following error.

 [2016-11-23 15:00:47,188] DEBUG - wire HTTP-Listener I/O dispatcher-6
 >> "POST /services/fileconnectorRead HTTP/1.1[\r][\n]"
 [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6
 >> "Host: vive.example.com:8280[\r][\n]"
 [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6
 >> "Connection: keep-alive[\r][\n]"
 

Re: [Dev] File read with enabling streaming

2016-11-24 Thread Vivekananthan Sivanayagam
Hi Malaka,

When I enable builders as I mentioned in the previous mail, It is working
always for the false statement[1] of streaming even enabling the streaming.
We have to use "", If I use this one, I am
getting
"PassThroughHttpSender Failed to submit the response" error.

We were able to write the file content into the message context but could
not get this as a response, and I checked the test case and found the
reason why it worked, there streaming is set as true and content type is
as "text/plain", in this case also consider as an else statement, that is
why test cases are passed.

[1]

​
​
InputStream in;

if (builder instanceof DataSourceMessageBuilder && "true".equals(streaming)) {
in = null;
dataSource = ManagedDataSourceFactory.create(new
FileObjectDataSource(file, contentType));
} else {
in = new AutoCloseInputStream(file.getContent().getInputStream());
dataSource = null;
}


Vivekananthan Sivanayagam
Associate Software Engineer | WSO2
E:vivekanant...@wso2.com
M:+94752786138

On Thu, Nov 24, 2016 at 10:23 AM, Vivekananthan Sivanayagam <
vivekanant...@wso2.com> wrote:

> Hi Malaka,
>
> When I use " class="org.wso2.carbon.relay.BinaryRelayBuilder"/>" instead of
> " class="org.apache.axis2.format.BinaryBuilder"/>",
> it is working fine.
>
> Vivekananthan Sivanayagam
> Associate Software Engineer | WSO2
> E:vivekanant...@wso2.com
> M:+94752786138
>
> On Wed, Nov 23, 2016 at 3:26 PM, Vivekananthan Sivanayagam <
> vivekanant...@wso2.com> wrote:
>
>> Hi Makala,
>>
>> I tried the given config and getting the following error.
>>
>> [2016-11-23 15:00:47,188] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "POST /services/fileconnectorRead HTTP/1.1[\r][\n]"
>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Host: vive.example.com:8280[\r][\n]"
>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Connection: keep-alive[\r][\n]"
>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Content-Length: 115[\r][\n]"
>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Postman-Token: 1cdab400-d939-ad00-29ca-2d65a4db15fb[\r][\n]"
>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Cache-Control: no-cache[\r][\n]"
>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,
>> like Gecko) Chrome/54.0.2840.100 Safari/537.36[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Content-Type: application/json[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Accept: */*[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Accept-Encoding: gzip, deflate[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Accept-Language: en-US,en;q=0.8[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "Cookie: exchangecookie=3220c865f3bc4a0981edd476a839a747[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "[\r][\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "{[\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> " "source":"/home/vive/Desktop/FILE/abc.txt",[\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> " "contentType":"application/file",[\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> " "streaming":"true"[\n]"
>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>> "}"
>> [2016-11-23 15:00:47,195] ERROR - SynapseJsonPath #stringValueOf. Error
>> evaluating JSON Path <$.address>. Returning empty result. Error>>> invalid
>> path
>> [2016-11-23 15:00:47,199] ERROR - SynapseJsonPath #stringValueOf. Error
>> evaluating JSON Path <$.append>. Returning empty result. Error>>> invalid
>> path
>> [2016-11-23 15:00:47,206] ERROR - SynapseJsonPath #stringValueOf. Error
>> evaluating JSON Path <$.address>. Returning empty result. Error>>> invalid
>> path
>> [2016-11-23 15:00:47,207] ERROR - SynapseJsonPath #stringValueOf. Error
>> evaluating JSON Path <$.append>. Returning empty result. Error>>> invalid
>> path
>> [2016-11-23 15:00:47,208] ERROR - SynapseJsonPath #stringValueOf. Error
>> evaluating JSON Path <$.source>. Returning empty result. Error>>> invalid
>> path
>> [2016-11-23 15:00:47,208] ERROR - SynapseJsonPath #stringValueOf. Error
>> evaluating JSON Path <$.contentType>. Returning empty result. Error>>>
>> invalid path
>> [2016-11-23 15:00:47,209] ERROR - SynapseJsonPath #stringValueOf. Error
>> evaluating JSON Path <$.streaming>. Returning empty result. 

Re: [Dev] File read with enabling streaming

2016-11-24 Thread Malaka Silva
On Thu, Nov 24, 2016 at 4:25 PM, Vivekananthan Sivanayagam <
vivekanant...@wso2.com> wrote:

> Hi Malaka,
>
> When I enable builders as I mentioned in the previous mail, It is working
> always for the false statement[1] of streaming even enabling the streaming.
> We have to use " class="org.apache.axis2.format.BinaryBuilder"/>", If I use this one, I am
> getting
> "PassThroughHttpSender Failed to submit the response" error.
>
​We have to dig into this and find the root cause.​


>
> We were able to write the file content into the message context but could
> not get this as a response, and I checked the test case and found the
> reason why it worked, there streaming is set as true and content type is
> as "text/plain", in this case also consider as an else statement, that is
> why test cases are passed.
>
​Currently latest connector read does not work. So ideally the test case
should fail.​


>
> [1]
>
> ​
> ​
> InputStream in;
>
> if (builder instanceof DataSourceMessageBuilder && "true".equals(streaming)) {
> in = null;
> dataSource = ManagedDataSourceFactory.create(new 
> FileObjectDataSource(file, contentType));
> } else {
> in = new AutoCloseInputStream(file.getContent().getInputStream());
> dataSource = null;
> }
>
>
> Vivekananthan Sivanayagam
> Associate Software Engineer | WSO2
> E:vivekanant...@wso2.com
> M:+94752786138
>
> On Thu, Nov 24, 2016 at 10:23 AM, Vivekananthan Sivanayagam <
> vivekanant...@wso2.com> wrote:
>
>> Hi Malaka,
>>
>> When I use "> class="org.wso2.carbon.relay.BinaryRelayBuilder"/>" instead of
>> "> class="org.apache.axis2.format.BinaryBuilder"/>", it is working fine.
>>
>> Vivekananthan Sivanayagam
>> Associate Software Engineer | WSO2
>> E:vivekanant...@wso2.com
>> M:+94752786138
>>
>> On Wed, Nov 23, 2016 at 3:26 PM, Vivekananthan Sivanayagam <
>> vivekanant...@wso2.com> wrote:
>>
>>> Hi Makala,
>>>
>>> I tried the given config and getting the following error.
>>>
>>> [2016-11-23 15:00:47,188] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "POST /services/fileconnectorRead HTTP/1.1[\r][\n]"
>>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Host: vive.example.com:8280[\r][\n]"
>>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Connection: keep-alive[\r][\n]"
>>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Content-Length: 115[\r][\n]"
>>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Postman-Token: 1cdab400-d939-ad00-29ca-2d65a4db15fb[\r][\n]"
>>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Cache-Control: no-cache[\r][\n]"
>>> [2016-11-23 15:00:47,189] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,
>>> like Gecko) Chrome/54.0.2840.100 Safari/537.36[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Content-Type: application/json[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Accept: */*[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Accept-Encoding: gzip, deflate[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Accept-Language: en-US,en;q=0.8[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "Cookie: exchangecookie=3220c865f3bc4a0981edd476a839a747[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "[\r][\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "{[\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> " "source":"/home/vive/Desktop/FILE/abc.txt",[\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> " "contentType":"application/file",[\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> " "streaming":"true"[\n]"
>>> [2016-11-23 15:00:47,190] DEBUG - wire HTTP-Listener I/O dispatcher-6 >>
>>> "}"
>>> [2016-11-23 15:00:47,195] ERROR - SynapseJsonPath #stringValueOf. Error
>>> evaluating JSON Path <$.address>. Returning empty result. Error>>> invalid
>>> path
>>> [2016-11-23 15:00:47,199] ERROR - SynapseJsonPath #stringValueOf. Error
>>> evaluating JSON Path <$.append>. Returning empty result. Error>>> invalid
>>> path
>>> [2016-11-23 15:00:47,206] ERROR - SynapseJsonPath #stringValueOf. Error
>>> evaluating JSON Path <$.address>. Returning empty result. Error>>> invalid
>>> path
>>> [2016-11-23 15:00:47,207] ERROR - SynapseJsonPath #stringValueOf. Error
>>> evaluating JSON Path <$.append>. Returning empty result. Error>>> invalid
>>> path
>>> [2016-11-23 15:00:47,208] ERROR - 

Re: [Dev] Exception related to eclipse BIRT when connecting DAS data using DAS JDBC driver

2016-11-24 Thread Pawan Gunaratne
Hi,

I have added that server certificate into the JDK keystore. So now it works
(can show the data) with *Squirrel client SQL*. But in Eclipse BIRT still
I'm getting that same exception.

Thanks,
Pawan

On Wed, Nov 23, 2016 at 9:25 AM, Anupama Pathirage  wrote:

> Hi,
>
> It seems this is occurred since the DAS server does not have a valid
> certificate from an authorized CA. Please add DAS server certificate in to
> JDK keystore and check by following steps.
>
>- Access the DAS url from browser and export the certificate
>- Export the certificate to JDK key store using keytool.
>
> Thanks,
> Anupama
>
> On Mon, Nov 21, 2016 at 1:06 AM, Pawan Gunaratne  wrote:
>
>> Hi,
>>
>> After creating the JDBC connection in Eclipse BIRT it didn't allow to get
>> the table data available in DAS. Also it didn't show any tables/streams
>> available in DAS. When I'm trying to retrieve the data using SELECT queries
>> it will throw the following exception.
>>
>> 
>> 
>> 
>> org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot get
>> the result set metadata.
>> org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement
>> does not return a ResultSet object.
>> SQL error #1:Error in Get Column Data Types :
>>  ;
>> java.sql.SQLException: Error in Get Column Data Types :
>> at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.ne
>> wException(ExceptionHandler.java:52)
>> at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.th
>> rowException(ExceptionHandler.java:108)
>> at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.th
>> rowException(ExceptionHandler.java:84)
>> at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.g
>> etRuntimeMetaData(PreparedStatement.java:414)
>> at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.g
>> etProjectedColumns(PreparedStatement.java:377)
>> at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.d
>> oGetMetaData(PreparedStatement.java:347)
>> at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.e
>> xecute(PreparedStatement.java:563)
>> at org.eclipse.birt.data.engine.executor.DataSourceQuery.execut
>> e(DataSourceQuery.java:980)
>> at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQu
>> eryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:607)
>> at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(Quer
>> yExecutor.java:1251)
>> at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.exe
>> cuteQuery(ServiceForQueryResults.java:233)
>> at org.eclipse.birt.data.engine.impl.QueryResults.getResultIter
>> ator(QueryResults.java:178)
>> at org.eclipse.birt.data.engine.impl.QueryResults.getResultMeta
>> Data(QueryResults.java:132)
>> at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHel
>> per.getRuntimeMetaData(DataSetMetaDataHelper.java:196)
>> at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHel
>> per.getRealMetaData(DataSetMetaDataHelper.java:155)
>> at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHel
>> per.getDataSetMetaData(DataSetMetaDataHelper.java:117)
>> at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHel
>> per.refreshMetaData(DataSetMetaDataHelper.java:385)
>> at org.eclipse.birt.report.data.adapter.impl.DataRequestSession
>> Impl.refreshMetaData(DataRequestSessionImpl.java:414)
>> at org.eclipse.birt.report.designer.data.ui.dataset.ExternalUIU
>> til.updateColumnCache(ExternalUIUtil.java:109)
>> at org.eclipse.birt.report.designer.data.ui.providers.DefaultDa
>> taServiceProvider.updateColumnCache(DefaultDataServiceProvider.java:139)
>> at org.eclipse.birt.report.designer.internal.ui.data.DataServic
>> e.updateColumnCache(DataService.java:173)
>> at org.eclipse.birt.report.designer.data.ui.dataset.DataSetUIUt
>> il.updateColumnCache(DataSetUIUtil.java:99)
>> at org.eclipse.birt.report.designer.data.ui.dataset.DataSetEdit
>> or.okPressed(DataSetEditor.java:687)
>> at org.eclipse.birt.report.designer.data.ui.property.AbstractPr
>> opertyDialog.buttonPressed(AbstractPropertyDialog.java:650)
>> at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:618)
>> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe
>> ner.java:249)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
>> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5219)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1340)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.
>> java:4553)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4143)
>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
>> at 

Re: [Dev] [DEV][ESB] Appending the file name dynamically in WSO2 file connector

2016-11-24 Thread Pubudu Priyashan
Thanks Shafreen and Keerthika,

This approach works fine.

Cheers,
Pubudu.

Pubudu D.P
Senior Software Engineer - QA Team | WSO2 inc.
Mobile : +94775464547

Linkedin: https://uk.linkedin.com/in/pubududp
Medium: https://medium.com/@pubududp


On Thu, Nov 24, 2016 at 1:54 PM, Shafreen Anfar  wrote:

> Hi Pubudu,
>
> What you can do is have the below part of the uri in some property.
>
>   value="file://home/pubudup/data/fileopen/inbound/
> original/"
>scope="default"
>type="STRING"/>
>
> And then have another property to append the file name to the end.
> Something like blew.
>
> 
> expression="fn:concat(get-property('filelocation'),get-property('FILE_NAME'),'
> ')"
>scope="default"
>type="STRING"/>
>
> Then in the connector try something as below,
>
> 
> *{$ctx:completeLocation}*
> sftp://john:@10.100.7.95/www/
> 1
> true
> 1
> false
> no
>  
>
>
>
> On Thu, Nov 24, 2016 at 1:42 PM, Pubudu Priyashan 
> wrote:
>
>> Hi all,
>>
>> I am using the file connector to copy a file from locationA to locationB.
>> I would like to know how we can identify the file name if it's variable and
>> append it to the file connector source url.
>>
>> for example, let's say I have already captured the file name in a
>> property.
>>
>> eg:-
>>  >expression="get-property('transport', 'FILE_NAME')"
>>scope="default"
>>type="STRING"/>
>>
>> I would like to append the value of the above property instead of having
>> 'test.pdf' in the source location in my file connector below.
>>
>>
>>  
>> file://home/pubudup/data/fileopen/inbound/original/
>> test.pdf
>> sftp://john:@10.100.7.95/www/
>> 1
>> true
>> 1
>> false
>> no
>>  
>>
>> Cheers,
>> Pubudu D.P
>> Senior Software Engineer - QA Team | WSO2 inc.
>> Mobile : +94775464547
>>
>> Linkedin: https://uk.linkedin.com/in/pubududp
>> Medium: https://medium.com/@pubududp
>>
>>
>
>
> --
> Regards,
> *Shafreen*
> Software Engineer
> WSO2 Inc
> Mobile : 077-556-395-1
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV][ESB] Appending the file name dynamically in WSO2 file connector

2016-11-24 Thread Shafreen Anfar
Hi Pubudu,

What you can do is have the below part of the uri in some property.

  

And then have another property to append the file name to the end.
Something like blew.



Then in the connector try something as below,


*{$ctx:completeLocation}*
sftp://john:@10.100.7.95/www/
1
true
1
false
no
 



On Thu, Nov 24, 2016 at 1:42 PM, Pubudu Priyashan  wrote:

> Hi all,
>
> I am using the file connector to copy a file from locationA to locationB.
> I would like to know how we can identify the file name if it's variable and
> append it to the file connector source url.
>
> for example, let's say I have already captured the file name in a property.
>
> eg:-
>  expression="get-property('transport', 'FILE_NAME')"
>scope="default"
>type="STRING"/>
>
> I would like to append the value of the above property instead of having
> 'test.pdf' in the source location in my file connector below.
>
>
>  
> file://home/pubudup/data/fileopen/inbound/
> original/test.pdf
> sftp://john:@10.100.7.95/www/
> 1
> true
> 1
> false
> no
>  
>
> Cheers,
> Pubudu D.P
> Senior Software Engineer - QA Team | WSO2 inc.
> Mobile : +94775464547
>
> Linkedin: https://uk.linkedin.com/in/pubududp
> Medium: https://medium.com/@pubududp
>
>


-- 
Regards,
*Shafreen*
Software Engineer
WSO2 Inc
Mobile : 077-556-395-1
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [DEV][ESB] Appending the file name dynamically in WSO2 file connector

2016-11-24 Thread Pubudu Priyashan
Hi all,

I am using the file connector to copy a file from locationA to locationB. I
would like to know how we can identify the file name if it's variable and
append it to the file connector source url.

for example, let's say I have already captured the file name in a property.

eg:-
 

I would like to append the value of the above property instead of having
'test.pdf' in the source location in my file connector below.


 

file://home/pubudup/data/fileopen/inbound/original/test.pdf
sftp://john:@10.100.7.95/www/
1
true
1
false
no
 

Cheers,
Pubudu D.P
Senior Software Engineer - QA Team | WSO2 inc.
Mobile : +94775464547

Linkedin: https://uk.linkedin.com/in/pubududp
Medium: https://medium.com/@pubududp
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev