ule子-使用文件连接器删除文件 [英] Mule - Delete files with Files Connector
问题描述
这是我的主要mule flow
:
HTTP > Payload > File (Create) > Property (File Name) JMS
JMS调用以JMS开头的other flow
JMS > JSON TO XML > File (Delete by file name)
首先,我用JSON
消息创建一个文件.
最后,当JSON
消息转换为XML
时,我尝试通过名称调用属性来删除文件,该文件告诉我名字. /p>
但是文件不会删除.它通过日志输出此操作:
Writing file to: C:\errors\91fa03a0-dd33-11e5-a0d9-408d5c4c1bf3.dat
如何删除它?
我尝试使用Connector Configuration
中的选项 autoDelete ,但不会删除.
<file:connector name="File1" outputPattern="#[message.inboundProperties.fileName]" autoDelete="true" streaming="false" validateConnections="true" doc:name="File"/>
您不能使用此文件出站终结点来删除文件.
例如,如果您将使用S3之类的东西,则可以,但是这些连接器是基于操作的".
这是要写入一个新文件或将数据追加到现有文件中.
autoDelete选项用于在文件入站端点读取文件后将其删除.
更多信息: https://docs.mulesoft.com/mule-user -guide/v/3.7/file-transport-reference
如果要删除,并在用例中使用Java代码,请使用File类中的方法: https://docs.oracle.com/javase/7 /docs/api/java/io/File.html
This is my main mule flow
:
HTTP > Payload > File (Create) > Property (File Name) JMS
And that JMS calls to other flow
that starts with JMS
JMS > JSON TO XML > File (Delete by file name)
Firstly, I create a file with the JSON
message.
And finally, when JSON
message is transformed to XML
, I try to delete the file by name calling a property that tell me the name.
But the files doesn't delete. Its output this action by log:
Writing file to: C:\errors\91fa03a0-dd33-11e5-a0d9-408d5c4c1bf3.dat
How can I do to delete it?
I tried with the option autoDelete in the Connector Configuration
but it doesn't delete.
<file:connector name="File1" outputPattern="#[message.inboundProperties.fileName]" autoDelete="true" streaming="false" validateConnections="true" doc:name="File"/>
You can't use this file outbound endpoint to delete a file.
If you would use something like S3 for example you can, but those connectors are 'operation-based'.
It's meant to write an new file or append data to an existing one.
The autoDelete option is for deleting the file once it has been read by a file inbound endpoint.
More info: https://docs.mulesoft.com/mule-user-guide/v/3.7/file-transport-reference
If you want to delete and for your usecase you should use a piece of JAVA code and use methods from the File Class: https://docs.oracle.com/javase/7/docs/api/java/io/File.html
这篇关于ule子-使用文件连接器删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!