Tag: mule component

Mule Zip文件并向FTP服务器发送压缩文件

我知道Mule非常支持使用该元素对数据进行gzip压缩。 但是客户端现在想要压缩压缩,因为文件必须作为zip压缩文件放在FTP上:( 我遇到以下情况的mule子困难: 我创建了一个文件进来的Spring bean。我想使用ZipOutputStream类压缩这个文件并将它传递给我们的ftp。 这是我的流程配置: 这是我的zip压缩器的代码: @Component public class ZipCompressor implements Callable { private static final Logger LOG = LogManager.getLogger(ZipCompressor.class.getName()); @Override @Transactional public Object onCall(MuleEventContext eventContext) throws Exception { if (eventContext.getMessage().getPayload() instanceof File) { final File srcFile = (File) eventContext.getMessage().getPayload(); final String fileName = srcFile.getName(); final File zipFile = new File(fileName + “.zip”); try […]