【问题标题】:camel-dropbox - Handle whitespace in dynamic remotePathcamel-dropbox - 处理动态 remotePath 中的空白
【发布时间】:2016-09-19 08:52:16
【问题描述】:

我遇到了一个非常简单的用例问题。

  1. 在 Dropbox 文件夹中搜索文件
  2. 选择要加载的文件
  3. 从 Dropbox 加载文件

我是这样尝试的:

from("timer:start?period=60m")
  //Load list of files
  .to("dropbox://search?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath={{remotePath}}")
  //Create list of files to load
  .bean(FileHandlerBean.class, "prepareOperations")
  .split(simple("${body}"))
    //Load file from dropbox
    .recipientList(simple("dropbox://get?accessToken={{accessToken}}&clientIdentifier={{clientIdentifier}}&remotePath=${body.dropBoxFilePath}"))
  [...]

通常这应该有效,但是当 remotePath 包含带有空格的文件名时,例如 2015-05-16 18.43.56.jpgDropboxConfigurationValidator 会引发异常。

我尝试使用 URLEncoder:

URLEncoder.encode(dbxEntry.path, "UTF-8")

但这无济于事。 我调试了组件,可以看到,当 DropBoxComponent 获取参数时,“+”被转换回空格。

有什么办法可以解决这个问题吗?

使用 Camel 版本 2.17.1

【问题讨论】:

标签: apache-camel


【解决方案1】:

将在下一个骆驼版本中修复此问题。 这是 Jira 票的链接:[CAMEL-10334]

那么就可以在 remotePath 属性中使用空格。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-09
    • 1970-01-01
    • 2020-01-20
    • 1970-01-01
    • 2018-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多