Skip to content
Snippets Groups Projects
Commit f04dfcc7 authored by Jan Zickermann's avatar Jan Zickermann
Browse files

OZG-4097 send-attachment: Fix sending attachments

parent de8154f5
No related branches found
Tags
No related merge requests found
......@@ -16,6 +16,12 @@ public record FileChunkInfo(
) {
public AbstractResource createUploadResource(InputStream fileInputStream) {
return new AbstractResource() {
@Override
public String getFilename() {
return upload.file().getName();
}
@Override
public String getDescription() {
return "File chunk " + chunkIndex + " of " + upload.getLoggableString();
......
......@@ -10,7 +10,7 @@ public record Osi2Attachment(
String guid,
OzgCloudFile file
) {
public static final long CHUNK_SIZE = 100L * (2L << 10);
public static final long CHUNK_SIZE = (2L << 14);
public static Osi2Attachment from(OzgCloudFile file) {
return Osi2Attachment.builder()
......
......@@ -113,7 +113,7 @@ public interface Osi2ResponseMapper {
}
default void checkChunkUploadSuccess(QuarantineFileResult quarantineFileResult) {
if (!Boolean.TRUE.equals(quarantineFileResult.getSuccess())) {
if (!Optional.ofNullable(quarantineFileResult.getError()).map(String::isBlank).orElse(true)) {
throw new Osi2RuntimeException(
"Chunk-Upload of file %s failed: %s".formatted(quarantineFileResult.getFileUid(), quarantineFileResult.getError()), null);
}
......
......@@ -2,7 +2,7 @@ ozgcloud:
osiv2:
enabled: false
auth:
client-id: 'OZG-Kopfstelle'
client-id: 'OZG-Kopfstelle-SH'
client-secret: 'changeme'
scope: default, access_urn:dataport:osi:sh:stage:ozgkopfstelle
token-uri: 'https://idp.serviceportal-stage.schleswig-holstein.de/webidp2/connect/token'
......
......@@ -12,7 +12,7 @@ import lombok.extern.log4j.Log4j2;
@Log4j2
public class AttachmentExampleUploadUtil {
public static final byte[] EXAMPLE_TEXT_DATA = LoremIpsum.getInstance().getParagraphs(5,100).getBytes();
public static final byte[] EXAMPLE_TEXT_DATA = LoremIpsum.getInstance().getParagraphs(5,10).getBytes();
public static String uploadTextFile(Osi2AttachmentFileService remoteService) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment