RED-6864 Upgrade search-service to new storage

This commit is contained in:
Andrei Isvoran 2023-08-16 16:00:02 +03:00
parent 0c66b4e505
commit bf9540a986
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));
}