Skip to content

Commit

Permalink
fix: fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikRevich committed Dec 8, 2024
1 parent ce3350c commit 0d3183e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api-server/src/main/openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<File, ContentDownloadBackupRequestDto> {
public class DownloadContentBackupClientService implements IClient<byte[], ContentDownloadBackupRequestDto> {
private final ContentResourceApi contentResourceApi;

public DownloadContentBackupClientService(String host) {
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 0d3183e

Please sign in to comment.