Merge branch 'RED-6864' into 'master'

RED-6864 Upgrade search-service to new storage

Closes RED-6864

See merge request redactmanager/search-service!6
This commit is contained in:
Andrei Isvoran 2023-08-17 08:54:11 +02:00
commit e24dfe7fbe
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@
<dependency>
<groupId>com.iqser.red</groupId>
<artifactId>platform-commons-dependency</artifactId>
<version>2.6.0</version>
<version>2.7.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>

View File

@ -32,14 +32,14 @@ public class FileSystemBackedStorageService implements StorageService {
@SneakyThrows
@Override
public InputStreamResource getObject(String tenantId, String objectId) {
public void downloadTo(String tenantId, String objectId, File destinationFile) {
var res = dataMap.get(objectId);
if (res == null) {
throw new StorageObjectDoesNotExist(new RuntimeException());
}
return new InputStreamResource(new FileInputStream(res));
IOUtils.copy(new FileInputStream(res), new FileOutputStream(destinationFile));
}