如何在Hybris中将图像添加到MediaModel?

如何在Hybris中将图像添加到MediaModel?,hybris,Hybris,我正在尝试以编程方式读取图像并将其添加到MediaModel中,但无法做到。热门文件夹基于Spring集成项目。您需要一些入站适配器来读取图像文件,需要一些服务激活器来转换图像,需要一些出站适配器将转换器介质写入新文件夹 <file:inbound-channel-adapter id="readFiles" directory="/path/to/data/mymedia" filename-regex="^(.*)-(\d+)\.jpg"> <int:pol

我正在尝试以编程方式读取图像并将其添加到MediaModel中,但无法做到。

热门文件夹基于Spring集成项目。您需要一些入站适配器来读取图像文件,需要一些服务激活器来转换图像,需要一些出站适配器将转换器介质写入新文件夹

<file:inbound-channel-adapter id="readFiles" directory="/path/to/data/mymedia"
    filename-regex="^(.*)-(\d+)\.jpg">
    <int:poller fixed-rate="1000" />
</file:inbound-channel-adapter>

<int:service-activator input-channel="readFiles" output-channel="convertedMedias" ref="someSpringBean"
    method="someMethod" />

<file:outbound-gateway request-channel="convertedMedias"
    directory="/path/to/data/convertedmedia" delete-source-files="true" />


您的设置是什么?您正在尝试实现热文件夹吗?调试代码告诉您什么?请说得更具体一些。是的,我正在尝试实现类似热文件夹的功能。我想使用mediaconversionstrategy将我的图像文件(位于data/mymedia文件夹中)转换为其他格式,并需要存储在另一个文件夹(data/convertedmedia)中。但无法找到解决方案。