在骆驼中的内部zip文件中设置文件名

发布于 2025-02-08 17:52:00 字数 547 浏览 0 评论 0 原文

我目前正在使用骆驼的文件拉链。 我在zip文件中的内部文件名遇到了一些问题。我正在尝试在标题中设置文件名,但文件名设置为我的整体zip文件(myfilename.zip)。我提取zip文件并使用messageId.txt提取文件后。我也想为我的zip内部文件设置一个文件名。 谁能帮我吗?

<to uri="amq:queue:INLET"/> <!--QUEUE TO FILE-->
  <setHeader name="FileName">
   <simple>myfilename</simple>
  </setHeader>
  <marshal>
    <zipfile/> 
  </marshal>          
<to uri="file:C:/Target/?fileName=${header.FileName}.zip"/>

I am currently working on a file zipping in camel.
I have faced some issues with the internal filename in the ZIP file. I am trying to set up the file name in the header but the file name is set up to my overall zip file (myfilename.zip). After I extracted the zip file and file exists with MessageID.txt. I want to set up a file name for my internal files of zip as well.
Can anyone help me with this?

<to uri="amq:queue:INLET"/> <!--QUEUE TO FILE-->
  <setHeader name="FileName">
   <simple>myfilename</simple>
  </setHeader>
  <marshal>
    <zipfile/> 
  </marshal>          
<to uri="file:C:/Target/?fileName=${header.FileName}.zip"/>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烂柯人 2025-02-15 17:52:00

标题名称应为 CAMELFILENAME ,而不是文件名

每个文档:

The header name should be CamelFileName, not FileName.

Per documentation: https://camel.apache.org/components/3.14.x/dataformats/zipfile-dataformat.html#_marshal

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文