Skip to content
Snippets Groups Projects
Commit 800b792a authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5665 List of OzgFiles to Set of OzgFiles

parent c6ad55eb
Branches
Tags
No related merge requests found
package de.ozgcloud.alfa.export; package de.ozgcloud.alfa.export;
import java.util.List; import java.util.Set;
import de.ozgcloud.alfa.common.file.OzgFile; import de.ozgcloud.alfa.common.file.OzgFile;
import de.xoev.xdomea.AbgabeAbgabe0401; import de.xoev.xdomea.AbgabeAbgabe0401;
...@@ -16,6 +16,6 @@ class ExportData { ...@@ -16,6 +16,6 @@ class ExportData {
private String exportFilename; private String exportFilename;
private AbgabeAbgabe0401 abgabe; private AbgabeAbgabe0401 abgabe;
private List<OzgFile> exportFiles; private Set<OzgFile> exportFiles;
} }
...@@ -6,8 +6,9 @@ import java.io.FileOutputStream; ...@@ -6,8 +6,9 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
...@@ -78,7 +79,7 @@ class ExportService { ...@@ -78,7 +79,7 @@ class ExportService {
postfachMailData.getAttachments().stream(), postfachMailData.getAttachments().stream(),
bescheidData.getFiles().stream()) bescheidData.getFiles().stream())
.flatMap(s -> s) .flatMap(s -> s)
.toList(); .collect(Collectors.toSet());
return ExportData.builder().abgabe(abgabe).exportFilename(buildXmlFilename(filenameId)).exportFiles(exportFiles).build(); return ExportData.builder().abgabe(abgabe).exportFilename(buildXmlFilename(filenameId)).exportFiles(exportFiles).build();
} }
...@@ -114,7 +115,7 @@ class ExportService { ...@@ -114,7 +115,7 @@ class ExportService {
zipOutputStream.closeEntry(); zipOutputStream.closeEntry();
} }
private void putFilesIntoZip(List<OzgFile> ozgFiles, ZipOutputStream zipOutputStream) { private void putFilesIntoZip(Set<OzgFile> ozgFiles, ZipOutputStream zipOutputStream) {
ozgFiles.forEach(ozgFile -> putOzgFileIntoZip(ozgFile, zipOutputStream)); ozgFiles.forEach(ozgFile -> putOzgFileIntoZip(ozgFile, zipOutputStream));
} }
......
package de.ozgcloud.alfa.export; package de.ozgcloud.alfa.export;
import java.util.List; import java.util.Set;
import de.ozgcloud.alfa.common.file.OzgFile; import de.ozgcloud.alfa.common.file.OzgFile;
import de.ozgcloud.alfa.common.file.OzgFileTestFactory; import de.ozgcloud.alfa.common.file.OzgFileTestFactory;
...@@ -20,6 +20,6 @@ class ExportDataTestFactory { ...@@ -20,6 +20,6 @@ class ExportDataTestFactory {
return ExportData.builder() return ExportData.builder()
.exportFilename(EXPORT_FILENAME) .exportFilename(EXPORT_FILENAME)
.abgabe(ABGABE) .abgabe(ABGABE)
.exportFiles(List.of(OZG_FILE)); .exportFiles(Set.of(OZG_FILE));
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment