Skip to content

Commit

Permalink
Added encoding UTF-8 for contract filename
Browse files Browse the repository at this point in the history
  • Loading branch information
pierpaolo.didato@emeal.nttdata.com authored and pierpaolo.didato@emeal.nttdata.com committed Sep 13, 2024
1 parent 6df0152 commit 0965194
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
import org.openapi.quarkus.party_registry_proxy_json.api.InstitutionApi;
import org.openapi.quarkus.party_registry_proxy_json.model.GeographicTaxonomyResource;
import org.openapi.quarkus.party_registry_proxy_json.model.InstitutionResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
Expand All @@ -33,8 +32,6 @@ public class BaseNotificationBuilder implements NotificationBuilder {
protected final GeographicTaxonomiesApi geographicTaxonomiesApi;
protected final org.openapi.quarkus.core_json.api.InstitutionApi coreInstitutionApi;
protected static final String DESCRIPTION_TO_REPLACE_REGEX = " - COMUNE";
protected static final Logger log = LoggerFactory.getLogger(BaseNotificationBuilder.class);


public BaseNotificationBuilder(
String alternativeEmail,
Expand Down Expand Up @@ -180,7 +177,7 @@ private BillingToSend convertBilling(Billing billing) {
@Override
public void setTokenData(NotificationToSend notificationToSend, Token token) {
if (Objects.nonNull(token) && Objects.nonNull(token.getContractSigned())) {
notificationToSend.setFileName(Paths.get(token.getContractSigned()).getFileName().toString());
notificationToSend.setFileName(Paths.get(new String(token.getContractSigned().getBytes(), StandardCharsets.UTF_8)).getFileName().toString());
notificationToSend.setContentType(token.getContractSigned());
}
}
Expand Down

0 comments on commit 0965194

Please sign in to comment.