问题标签 [spring-content-community-project]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
12 浏览

spring-content-community-project - Spring-Content:将文件从内容存储移动到另一个内容存储

我想要什么:我想使用版本 1.2.7将内容从一个ContentStore(常规)移动到另一个ContentStore(例如存档) 。Spring-Content

我所做的是这个(它至少对DefaultFilesystemStoreImpls 有效):

  1. 像这样创建两个ContentStores:
  1. 像这样将内容从一个移动ContentStore到另一个:

问题:这是移动(/归档)内容的预期方式,Spring-Content还是有更优雅/更方便/更预期的移动/归档文件的方式(尤其是从文件系统到 S3 并再次返回)?

0 投票
1 回答
18 浏览

spring-content-community-project - Spring-Content 1.2.7:ContentStore 的标识符

我打算做什么:我想ContentStore在同一个系统中使用多个 s:一个用于新上传的文件(文件系统),一个用于(长期)归档(AWS S3 或 GCS)。

我尝试过的(以及实际有效的):

  1. File通过另一个属性扩展类private String contentStoreName;

  2. 像这里描述的那样创建两个ContentStoreSpring-Content:将文件从内容存储移动到另一个内容存储

  3. gettingstarted.FileContentController.setContent(Long, MultipartFile)通过为 used 设置标识符来扩展ContentStoref.get().setContentStoreName("regular");

  4. 根据存储的内容获取内容contentStoreName

  5. contentStoreName从一个移动到另一个时更改ContentStore

关于这个的气味:尽管这段代码有效,但我想这不是预期的方式,因为Spring-content通常在后台做很多注释和一些魔法。但我找不到ContentStore.

问题:有没有更有意的方式来做到这一点Spring-Content