file - 使用骆驼文件语言
问题描述
我们正在尝试使用文件组件的 move、preMove 和 Error 选项。这是我们的目录结构
//root/child/ic/dir1/child1 //root/child/ic/dir1/child2
当从 child1 读取要处理的文件时,我们希望将其移动到 child1 中的 inprogress,然后在 //root/child/ic/dir1//processed 处处理
我们尝试了许多文件语言语法的组合,但似乎没有任何效果。这里有几个例子
对于 move/${date:now:yyyyMMdd}/${file:name} 日期组件永远不会将模式解析为真实日期,并且 file:name 也无法解析如何给出 ?move=../processed 以便文件上移一个目录到 //root/child/ic/ llly
我还想将转换后的文件移动到相对于 //root/child/ic/ 的文件夹中。我们将根文件夹设置在 ${user.home}/root/child/ic。由于我们有许多子文件夹并且我们希望转换后的文件相对于子文件夹保持相对路径,因此我们如何提供相对路径而无需对其进行硬编码。
解决方案
When we did the following in our consts file it worked.public static final String FILE_COMPONENT_CONFIG = "file:{xxx.agent.rootDir}}?" +
"preMove={{xxx.agent.preMove}}&" +
"move=${file:parent}/../{{xxx.agent.move}}/${file:onlyname.noext.single}_${date:now:yyyyMMdd-hhmmss}.${file:name.ext}&" +
"moveFailed=${file:parent}/../{{xxxx.agent.moveFailed}}/${file:onlyname.noext.single}_${date:now:yyyyMMdd-hhmmss}.${file:name.ext}&" +
"idempotent={{xxx.agent.idempotent}}&" +
"idempotentRepository=#trackRepository&" +
"delay=30000&" +
"include={{xxxx.agent.include}}&" +
"recursive=true&" +
"minDepth=2&" +
"antExclude={{xxxx.agent.exclude}}";
推荐阅读
- python-3.x - 如何根据 Apache NiFi 中的属性值执行脚本(比如 python 或 java 等)
- c# - “/”应用程序中的服务器错误。指定的转换无效
- opencv - 如何在 Opencv 中使用 Pytorch 张量对象而不转换为 numpy 数组?
- reactjs - React 按钮单击隐藏和显示组件
- openlayers - 从 OpenLayers 中的 WMS 图层获取多边形内的要素
- python - GET API 中的 flask_restful 类似数组的参数
- expo - 如何使用 Expo 的 Manage Work 流程生成 Apk 文件
- spring-boot - 为什么我的 spring-boot 应用程序在 Intellij 中给出“ClassNotFoundException:javax.servlet.Filter”但在 STS 3 中没有?
- visual-studio-code - 如何更改 VS Code 用于 linting 的 .pylintrc 文件?
- ssh - 如何手动执行 sudo chown 命令