微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何将自定义 setContent 方法添加到 Spring Content

如何解决如何将自定义 setContent 方法添加到 Spring Content

我使用 Spring Content https://paulcwarren.github.io/spring-content/ 来管理文件。 有我用来设置内容方法

public interface ContentStore<S,SID extends Serializable> extends ContentRepository<S,SID> {

@LockParticipant
void setContent(S property,InputStream content);

问题是我想创建一个自定义方法

void setArchivedContent(S property,List<Resource> resources);

这应该将 ZIP 资源压缩到一个文件中。 所以我创建了

public interface ArchiveStore<S,SID> {

在实现标准方法的地方实现它,并为 Store 添加一个接口

public class GoogleCloudStoreImpl<S,SID extends Serializable>
implements Store<SID>,AssociativeStore<S,SID>,ContentStore<S,ArchiveStore<S,SID> 

public interface MyEntryArchiveStore extends ContentStore<MyEntryArchive,UUID>,AssociativeStore<MyEntryArchive,ArchiveStore<MyEntryArchive,UUID> {

当我运行代码并尝试触发这个方法时,我遇到了一个问题:Spring找不到这个方法的实现。但它在 GoogleCloudStoreImpl 中

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。