Discussion:
Camel-box download file version
Vladimir Cherepnalkovski
2018-11-21 13:12:12 UTC
Permalink
Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
.log("********* Downloading file version *********")
.setHeader("CamelBox.fileId", method(service, "getFileId"))
.setHeader("CamelBox.output", method(service, "getFileOutputStream"))
.setHeader("CamelBox.version", method(service, "getFileVersion"))
.to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Andrea Cosentino
2018-11-21 13:32:13 UTC
Permalink
Did you try by specifying option directly in the URI by using a toD?

If you think this is a bug, please raise a JIRA in the Apache Camel JIRA.

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 2:12:23 PM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote:





Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
        .log("********* Downloading file version *********")
        .setHeader("CamelBox.fileId", method(service, "getFileId"))
        .setHeader("CamelBox.output", method(service, "getFileOutputStream"))
        .setHeader("CamelBox.version", method(service, "getFileVersion"))
        .to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Vladimir Cherepnalkovski
2018-11-21 14:13:22 UTC
Permalink
Yes, I tried that too.



I tried two options :

.toD("box://files/downloadVersion?version=1");
Exception : Failed to resolve endpoint: box://files/downloadVersion?version=1 due to: No matching method for files/downloadVersion, with arguments [version]

version id received from “BoxFile.Info” is 374220338428

.toD("box://files/downloadVersion?version=374220338428");

Exception : Failed to resolve endpoint: box://files/downloadVersion?version=374220338428 due to: org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: java.lang.Integer with value 374220338428 due For input string: "374220338428"



I this this is some bug. How to open a ticket ?






Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



________________________________
From: Andrea Cosentino <***@yahoo.com.INVALID>
Sent: Wednesday, November 21, 2018 2:32:13 PM
To: ***@camel.apache.org
Subject: Re: Camel-box download file version

Did you try by specifying option directly in the URI by using a toD?

If you think this is a bug, please raise a JIRA in the Apache Camel JIRA.

--
Andrea Cosentino
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 2:12:23 PM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote:





Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
.log("********* Downloading file version *********")
.setHeader("CamelBox.fileId", method(service, "getFileId"))
.setHeader("CamelBox.output", method(service, "getFileOutputStream"))
.setHeader("CamelBox.version", method(service, "getFileVersion"))
.to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Andrea Cosentino
2018-11-21 14:18:16 UTC
Permalink
Hello,

You need to raise the JIRA here:

https://issues.apache.org/jira/projects/CAMEL

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 3:13:33 PM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote:





Yes, I tried that too.



I tried two options :

.toD("box://files/downloadVersion?version=1");
Exception : Failed to resolve endpoint: box://files/downloadVersion?version=1 due to: No matching method for files/downloadVersion, with arguments [version]

version id received from “BoxFile.Info” is  374220338428

.toD("box://files/downloadVersion?version=374220338428");

Exception : Failed to resolve endpoint: box://files/downloadVersion?version=374220338428 due to: org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: java.lang.Integer with value 374220338428 due For input string: "374220338428"



I this this is some bug. How to open a ticket ?






Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



________________________________

From: Andrea Cosentino <***@yahoo.com.INVALID>
Sent: Wednesday, November 21, 2018 2:32:13 PM
To: ***@camel.apache.org
Subject: Re: Camel-box download file version

Did you try by specifying option directly in the URI by using a toD?

If you think this is a bug, please raise a JIRA in the Apache Camel JIRA.

--
Andrea Cosentino
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 21, 2018, 2:12:23 PM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote:





Hi All,

I am trying to create Camel-Box route for downloading older file version.
I am using Camel version 2.22.1


This Is the code

from("seda:downloadFileQueue").setExchangePattern(ExchangePattern.InOut)
        .log("********* Downloading file version *********")
        .setHeader("CamelBox.fileId", method(service, "getFileId"))
        .setHeader("CamelBox.output", method(service, "getFileOutputStream"))
        .setHeader("CamelBox.version", method(service, "getFileVersion"))
        .to("box://files/downloadVersion");

The exception is :
Failed to resolve endpoint: box://files/downloadVersion due to: No matching method for files/downloadVersion, with arguments [].

I have tried with “downloadPreviousFileVersions” and “downloadVersion” endpoints, but with no success.


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
Vladimir Cherepnalkovski
2018-11-28 10:11:26 UTC
Permalink
I found the issue, and a solution.


First there is a mistake in camel - box documentation.


Endpoint "downloadPreviousFileVersions" should be "downloadPreviousFileVersion".


If we use full endpoint name downloadPreviousFileVersion, the route will work.


Also, there is a problem in camel - box endpoint mapping.

I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.
Andrea Cosentino
2018-11-28 10:22:38 UTC
Permalink
You're welcome to work on a PR.

The documentation for this component is here

https://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/src/main/docs/box-component.adoc

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 28, 2018, 11:19:12 AM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote:





I found the issue, and a solution.


First there is a mistake in camel - box documentation.


Endpoint "downloadPreviousFileVersions" should be  "downloadPreviousFileVersion".


If we use full endpoint name downloadPreviousFileVersion, the route will work.


Also, there is a problem in camel - box endpoint mapping.

I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.
Andrea Cosentino
2018-11-28 10:44:00 UTC
Permalink
That class is generated. You just need to change the methodPattern here:

https://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/pom.xml#L278

If you are fancy opening a PR about that after testing the fix, you're welcome to do it

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 28, 2018, 11:35:48 AM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote:







Done. 

 

I hope that someone will change the mapping on backend, so the shorthand alias will be available for use.

 





From: Andrea Cosentino <***@yahoo.com.INVALID>
Sent: Wednesday, November 28, 2018 11:22 AM
To: ***@camel.apache.org
Subject: Re: Camel-box download file version


 





You're welcome to work on a PR.The documentation for this component is herehttps://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/src/main/docs/box-component.adoc


  



    

camel/box-component.adoc at master · apache/camel · GitHub

  

github.com

  

Box.com requires the use of OAuth2.0 for all client application authentication. In order to use camel-box with your account, you’ll need to create a new application within Box.com at https://developer.box.com.The Box application’s client id and secret will allow access to Box APIs which require a current user.


  





--Andrea Cosentino ----------------------------------Apache Camel PMC ChairApache Karaf CommitterApache Servicemix PMC MemberEmail: ***@yahoo.comTwitter: @oscerd2Github: oscerdOn Wednesday, November 28, 2018, 11:19:12 AM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote: I found the issue, and a solution.First there is a mistake in camel - box documentation.Endpoint "downloadPreviousFileVersions" should be  "downloadPreviousFileVersion".If we use full endpoint name downloadPreviousFileVersion, the route will work.Also, there is a problem in camel - box endpoint mapping.I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.
Vladimir Cherepnalkovski
2018-11-28 10:49:51 UTC
Permalink
I will test this, and reply.



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10



________________________________
From: Andrea Cosentino <***@yahoo.com.INVALID>
Sent: Wednesday, November 28, 2018 11:44:00 AM
To: ***@camel.apache.org; Vladimir Cherepnalkovski
Subject: Re: Camel-box download file version

That class is generated. You just need to change the methodPattern here:

https://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/pom.xml#L278

If you are fancy opening a PR about that after testing the fix, you're welcome to do it

--
Andrea Cosentino
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Wednesday, November 28, 2018, 11:35:48 AM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote:







Done.



I hope that someone will change the mapping on backend, so the shorthand alias will be available for use.







From: Andrea Cosentino <***@yahoo.com.INVALID>
Sent: Wednesday, November 28, 2018 11:22 AM
To: ***@camel.apache.org
Subject: Re: Camel-box download file version








You're welcome to work on a PR.The documentation for this component is herehttps://github.com/apache/camel/blob/master/components/camel-box/camel-box-component/src/main/docs/box-component.adoc








camel/box-component.adoc at master · apache/camel · GitHub



github.com



Box.com requires the use of OAuth2.0 for all client application authentication. In order to use camel-box with your account, you’ll need to create a new application within Box.com at https://developer.box.com.The Box application’s client id and secret will allow access to Box APIs which require a current user.








--Andrea Cosentino ----------------------------------Apache Camel PMC ChairApache Karaf CommitterApache Servicemix PMC MemberEmail: ***@yahoo.comTwitter: @oscerd2Github: oscerdOn Wednesday, November 28, 2018, 11:19:12 AM GMT+1, Vladimir Cherepnalkovski <***@hotmail.com> wrote: I found the issue, and a solution.First there is a mistake in camel - box documentation.Endpoint "downloadPreviousFileVersions" should be "downloadPreviousFileVersion".If we use full endpoint name downloadPreviousFileVersion, the route will work.Also, there is a problem in camel - box endpoint mapping.I saw that shorthand alias name is mapped to "downloadPreviousFileVersions" which not exists.
Continue reading on narkive:
Loading...