spring - 在骆驼路线中当 move=null 时会发生什么?
问题描述
在我的 Spring Camel 应用程序中,我尝试基于destinationFolder
属性移动或删除文件。如果destinationFolder=null
,我希望删除该文件。如果destinationFolder!=null
,我希望将文件移动到destinationFolder
.
String destinationFolder;
//In the Camel routeBuilder:
from("file://C:/folder1?move=" + destinationFolder)
destinationFolder 为空会发生什么?文件是否移动到默认位置?
当我设置destinationFolder=null 时,我看到文件夹1 中的文件已被删除。
解决方案
如果您设置了移动选项,那么文件组件将移动文件,您不能将其设置为null
然后让它自动删除文件。默认情况下,该文件被移动到名为.camel
.
所以要么设置 delete=true 要么设置移动到某个文件夹名称来移动文件。
推荐阅读
- c# - DevExpress 错误缺少 using 指令或程序集引用
- typescript - 打字稿生成器功能作为参数
- php - 在 elasticsearch 中为查询定义自定义分析器时出错
- python - 如何使用 urllib3 发出 put 请求
- c# - 如何从包含该值的列表中删除一个值?
- java - 使用按钮将文件添加到 JList
- bash - 是否可以将 if 语句放入管道中?
- javascript - 更新按钮上的超链接(ajax json)
- java - 在我的 documentrefernce firesotre 集合中显示的片段 illigleState 异常中
- python - 如何在odoo中使用自定义名称更改上传的附件文件名