diff --git a/api-server/src/main/openapi/openapi.yml b/api-server/src/main/openapi/openapi.yml index 41a50b1..8937c2d 100644 --- a/api-server/src/main/openapi/openapi.yml +++ b/api-server/src/main/openapi/openapi.yml @@ -154,7 +154,7 @@ paths: application/zip: schema: type: string - format: binary + format: byte 400: description: Content backup was not retrieved /v1/content/object/clean: diff --git a/cli/src/main/java/com/objectstorage/service/client/content/download/backup/DownloadContentBackupClientService.java b/cli/src/main/java/com/objectstorage/service/client/content/download/backup/DownloadContentBackupClientService.java index b219283..1e9f767 100644 --- a/cli/src/main/java/com/objectstorage/service/client/content/download/backup/DownloadContentBackupClientService.java +++ b/cli/src/main/java/com/objectstorage/service/client/content/download/backup/DownloadContentBackupClientService.java @@ -14,12 +14,10 @@ import org.springframework.web.reactive.function.client.WebClientResponseException; import reactor.netty.http.client.HttpClient; -import java.io.File; - /** * Represents implementation for v1ContentBackupDownloadPost endpoint of ContentResourceApi. */ -public class DownloadContentBackupClientService implements IClient { +public class DownloadContentBackupClientService implements IClient { private final ContentResourceApi contentResourceApi; public DownloadContentBackupClientService(String host) { @@ -40,7 +38,7 @@ public DownloadContentBackupClientService(String host) { * @see IClient */ @Override - public File process(ContentDownloadBackupRequestDto input) throws ApiServerOperationFailureException { + public byte[] process(ContentDownloadBackupRequestDto input) throws ApiServerOperationFailureException { try { return contentResourceApi .v1ContentBackupDownloadPost( diff --git a/cli/src/main/java/com/objectstorage/service/command/external/download/backup/DownloadBackupExternalCommandService.java b/cli/src/main/java/com/objectstorage/service/command/external/download/backup/DownloadBackupExternalCommandService.java index 96aede3..800dfe9 100644 --- a/cli/src/main/java/com/objectstorage/service/command/external/download/backup/DownloadBackupExternalCommandService.java +++ b/cli/src/main/java/com/objectstorage/service/command/external/download/backup/DownloadBackupExternalCommandService.java @@ -121,12 +121,11 @@ public void process(DownloadBackupExternalCommandDto downloadBackupExternalComma validationSecretsApplicationResult.getToken(), ContentBackupDownload.of(downloadBackupExternalCommand.getLocation())); - File contentBackupDownloadResult = downloadContentBackupClientService.process(request); + byte[] contentBackupDownloadResult = downloadContentBackupClientService.process(request); try { FileUtils.writeByteArrayToFile( - new File(downloadBackupExternalCommand.getOutputLocation()), - Files.readAllBytes(contentBackupDownloadResult.toPath())); + new File(downloadBackupExternalCommand.getOutputLocation()), contentBackupDownloadResult); } catch (IOException e) { throw new ApiServerOperationFailureException(e.getMessage()); }