Skip to content

Commit

Permalink
Fix encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-barchi committed Feb 2, 2024
1 parent 7c72d95 commit 1f6ffc0
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
import it.gov.pagopa.fdrtechsupport.repository.model.FdrHistoryBlobRefEntity;
import it.gov.pagopa.fdrtechsupport.util.Util;
import jakarta.enterprise.context.ApplicationScoped;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -169,9 +171,11 @@ private FdrByPspIdIuvIurBase tableEntityToIuvIurBaseEntity(TableEntity e) {

public String getBlobByNameAndRevision(DateRequest dates, String name, String revision) {
FdrHistoryBlobRefEntity refEntity = findFlowByNameAndRevision(dates, name, revision);
return getBlobContainerClient(refEntity.getContainerName())
.getBlobClient(refEntity.getFileName())
.downloadContent()
.toString();
byte[] byteArray =
getBlobContainerClient(refEntity.getContainerName())
.getBlobClient(refEntity.getFileName())
.downloadContent()
.toBytes();
return new String(Base64.getEncoder().encode(byteArray), StandardCharsets.UTF_8);
}
}

0 comments on commit 1f6ffc0

Please sign in to comment.