This commit is contained in:
Anthony Stirling 2024-01-01 14:46:19 +00:00
parent b5423f3434
commit 03a8f45128
3 changed files with 50 additions and 55 deletions

View file

@ -137,7 +137,4 @@ public class SplitPdfBySectionsController {
return splitDocuments; return splitDocuments;
} }
} }

View file

@ -2,11 +2,11 @@ package stirling.software.SPDF.controller.api.pipeline;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -82,7 +82,6 @@ public class PipelineController {
return null; return null;
} }
// Create a ByteArrayOutputStream to hold the zip // Create a ByteArrayOutputStream to hold the zip
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zipOut = new ZipOutputStream(baos); ZipOutputStream zipOut = new ZipOutputStream(baos);

View file

@ -248,8 +248,7 @@ public class PipelineProcessor {
return newOutputFiles; return newOutputFiles;
} }
public String extractFilename(ResponseEntity<byte[]> response) {
public String extractFilename(ResponseEntity<byte[]> response) {
String filename = "default-filename.ext"; // Default filename if not found String filename = "default-filename.ext"; // Default filename if not found
HttpHeaders headers = response.getHeaders(); HttpHeaders headers = response.getHeaders();
@ -269,7 +268,7 @@ public String extractFilename(ResponseEntity<byte[]> response) {
} }
return filename; return filename;
} }
List<Resource> generateInputFiles(File[] files) throws Exception { List<Resource> generateInputFiles(File[] files) throws Exception {
if (files == null || files.length == 0) { if (files == null || files.length == 0) {