mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-10-25 11:17:28 +02:00 
			
		
		
		
	api tag
This commit is contained in:
		
							parent
							
								
									c81c1006b7
								
							
						
					
					
						commit
						3377af1305
					
				| @ -1,15 +1,12 @@ | |||||||
| package stirling.software.SPDF; | package stirling.software.SPDF; | ||||||
| 
 | 
 | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.boot.SpringApplication; | import org.springframework.boot.SpringApplication; | ||||||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | import org.springframework.boot.autoconfigure.SpringBootApplication; | ||||||
| import java.awt.*; | import org.springframework.core.env.Environment; | ||||||
| import java.net.URI; |  | ||||||
| 
 | 
 | ||||||
| import jakarta.annotation.PostConstruct; | import jakarta.annotation.PostConstruct; | ||||||
| 
 | 
 | ||||||
| import org.springframework.beans.factory.annotation.Autowired; |  | ||||||
| import org.springframework.core.env.Environment; |  | ||||||
| 
 |  | ||||||
| @SpringBootApplication | @SpringBootApplication | ||||||
| public class SPdfApplication { | public class SPdfApplication { | ||||||
| 	 | 	 | ||||||
|  | |||||||
| @ -17,9 +17,11 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "General", description = "General APIs") | ||||||
| public class MergeController { | public class MergeController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(MergeController.class); |     private static final Logger logger = LoggerFactory.getLogger(MergeController.class); | ||||||
|  | |||||||
| @ -24,9 +24,11 @@ import com.itextpdf.kernel.pdf.xobject.PdfFormXObject; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "General", description = "General APIs") | ||||||
| public class MultiPageLayoutController { | public class MultiPageLayoutController { | ||||||
| 
 | 
 | ||||||
| 	private static final Logger logger = LoggerFactory.getLogger(MultiPageLayoutController.class); | 	private static final Logger logger = LoggerFactory.getLogger(MultiPageLayoutController.class); | ||||||
|  | |||||||
| @ -18,10 +18,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.GeneralUtils; | import stirling.software.SPDF.utils.GeneralUtils; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "General", description = "General APIs") | ||||||
| public class RearrangePagesPDFController { | public class RearrangePagesPDFController { | ||||||
| 
 | 
 | ||||||
| 	private static final Logger logger = LoggerFactory.getLogger(RearrangePagesPDFController.class); | 	private static final Logger logger = LoggerFactory.getLogger(RearrangePagesPDFController.class); | ||||||
|  | |||||||
| @ -16,9 +16,11 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "General", description = "General APIs") | ||||||
| public class RotationController { | public class RotationController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(RotationController.class); |     private static final Logger logger = LoggerFactory.getLogger(RotationController.class); | ||||||
|  | |||||||
| @ -39,9 +39,11 @@ import io.swagger.v3.oas.annotations.Hidden; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "General", description = "General APIs") | ||||||
| public class ScalePagesController { | public class ScalePagesController { | ||||||
| 
 | 
 | ||||||
| 	private static final Logger logger = LoggerFactory.getLogger(ScalePagesController.class); | 	private static final Logger logger = LoggerFactory.getLogger(ScalePagesController.class); | ||||||
|  | |||||||
| @ -15,9 +15,6 @@ import org.apache.pdfbox.pdmodel.PDDocument; | |||||||
| import org.apache.pdfbox.pdmodel.PDPage; | import org.apache.pdfbox.pdmodel.PDPage; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| import org.springframework.core.io.ByteArrayResource; |  | ||||||
| import org.springframework.core.io.Resource; |  | ||||||
| import org.springframework.http.HttpHeaders; |  | ||||||
| import org.springframework.http.MediaType; | import org.springframework.http.MediaType; | ||||||
| import org.springframework.http.ResponseEntity; | import org.springframework.http.ResponseEntity; | ||||||
| import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||||
| @ -28,10 +25,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.GeneralUtils; | import stirling.software.SPDF.utils.GeneralUtils; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "General", description = "General APIs") | ||||||
| public class SplitPDFController { | public class SplitPDFController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(SplitPDFController.class); |     private static final Logger logger = LoggerFactory.getLogger(SplitPDFController.class); | ||||||
|  | |||||||
| @ -20,9 +20,11 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.PdfUtils; | import stirling.software.SPDF.utils.PdfUtils; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Convert", description = "Convert APIs") | ||||||
| public class ConvertImgPDFController { | public class ConvertImgPDFController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(ConvertImgPDFController.class); |     private static final Logger logger = LoggerFactory.getLogger(ConvertImgPDFController.class); | ||||||
|  | |||||||
| @ -17,10 +17,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import stirling.software.SPDF.utils.ProcessExecutor; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Convert", description = "Convert APIs") | ||||||
| public class ConvertOfficeController { | public class ConvertOfficeController { | ||||||
| 
 | 
 | ||||||
|     public byte[] convertToPdf(MultipartFile inputFile) throws IOException, InterruptedException { |     public byte[] convertToPdf(MultipartFile inputFile) throws IOException, InterruptedException { | ||||||
|  | |||||||
| @ -12,9 +12,11 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.PDFToFile; | import stirling.software.SPDF.utils.PDFToFile; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Convert", description = "Convert APIs") | ||||||
| public class ConvertPDFToOffice { | public class ConvertPDFToOffice { | ||||||
| 
 | 
 | ||||||
| 	@PostMapping(consumes = "multipart/form-data", value = "/pdf-to-html") | 	@PostMapping(consumes = "multipart/form-data", value = "/pdf-to-html") | ||||||
|  | |||||||
| @ -14,10 +14,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import stirling.software.SPDF.utils.ProcessExecutor; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Convert", description = "Convert APIs") | ||||||
| public class ConvertPDFToPDFA { | public class ConvertPDFToPDFA { | ||||||
| 
 | 
 | ||||||
| 	@PostMapping(consumes = "multipart/form-data", value = "/pdf-to-pdfa") | 	@PostMapping(consumes = "multipart/form-data", value = "/pdf-to-pdfa") | ||||||
|  | |||||||
| @ -28,12 +28,13 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import stirling.software.SPDF.pdf.ImageFinder; | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.PdfUtils; | import stirling.software.SPDF.utils.PdfUtils; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import stirling.software.SPDF.utils.ProcessExecutor; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class BlankPageController { | public class BlankPageController { | ||||||
| 
 | 
 | ||||||
| 	@PostMapping(consumes = "multipart/form-data", value = "/remove-blanks") | 	@PostMapping(consumes = "multipart/form-data", value = "/remove-blanks") | ||||||
|  | |||||||
| @ -31,11 +31,13 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.GeneralUtils; | import stirling.software.SPDF.utils.GeneralUtils; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import stirling.software.SPDF.utils.ProcessExecutor; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class CompressController { | public class CompressController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(CompressController.class); |     private static final Logger logger = LoggerFactory.getLogger(CompressController.class); | ||||||
|  | |||||||
| @ -31,10 +31,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import stirling.software.SPDF.utils.ProcessExecutor; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class ExtractImageScansController { | public class ExtractImageScansController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(ExtractImageScansController.class); |     private static final Logger logger = LoggerFactory.getLogger(ExtractImageScansController.class); | ||||||
|  | |||||||
| @ -29,8 +29,10 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class ExtractImagesController { | public class ExtractImagesController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(ExtractImagesController.class); |     private static final Logger logger = LoggerFactory.getLogger(ExtractImagesController.class); | ||||||
|  | |||||||
| @ -1,12 +1,31 @@ | |||||||
| package stirling.software.SPDF.controller.api.other; | package stirling.software.SPDF.controller.api.other; | ||||||
| 
 | 
 | ||||||
|  | import java.awt.Color; | ||||||
|  | import java.awt.geom.AffineTransform; | ||||||
|  | import java.awt.image.AffineTransformOp; | ||||||
|  | //Required for image manipulation | ||||||
|  | import java.awt.image.BufferedImage; | ||||||
|  | import java.awt.image.BufferedImageOp; | ||||||
|  | import java.awt.image.ConvolveOp; | ||||||
|  | import java.awt.image.Kernel; | ||||||
|  | import java.awt.image.RescaleOp; | ||||||
|  | //Required for file input/output | ||||||
|  | import java.io.File; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| import java.nio.file.Files; | //Other required classes | ||||||
| import java.nio.file.Path; | import java.util.Random; | ||||||
| import java.util.ArrayList; | 
 | ||||||
| import java.util.List; | //Required for image input/output | ||||||
|  | import javax.imageio.ImageIO; | ||||||
| 
 | 
 | ||||||
| import org.apache.pdfbox.pdmodel.PDDocument; | import org.apache.pdfbox.pdmodel.PDDocument; | ||||||
|  | import org.apache.pdfbox.pdmodel.PDPage; | ||||||
|  | import org.apache.pdfbox.pdmodel.PDPageContentStream; | ||||||
|  | import org.apache.pdfbox.pdmodel.common.PDRectangle; | ||||||
|  | import org.apache.pdfbox.pdmodel.graphics.image.LosslessFactory; | ||||||
|  | import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject; | ||||||
|  | import org.apache.pdfbox.rendering.ImageType; | ||||||
|  | import org.apache.pdfbox.rendering.PDFRenderer; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| import org.springframework.http.ResponseEntity; | import org.springframework.http.ResponseEntity; | ||||||
| @ -17,43 +36,14 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import com.itextpdf.io.source.ByteArrayOutputStream; | import com.itextpdf.io.source.ByteArrayOutputStream; | ||||||
| 
 | 
 | ||||||
|  | import io.swagger.v3.oas.annotations.Hidden; | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| //Required for PDF manipulation |  | ||||||
| import org.apache.pdfbox.pdmodel.PDDocument; |  | ||||||
| import org.apache.pdfbox.pdmodel.PDPage; |  | ||||||
| import org.apache.pdfbox.pdmodel.PDPageContentStream; |  | ||||||
| import org.apache.pdfbox.pdmodel.common.PDRectangle; |  | ||||||
| import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject; |  | ||||||
| import org.apache.pdfbox.pdmodel.graphics.image.LosslessFactory; |  | ||||||
| import org.apache.pdfbox.rendering.ImageType; |  | ||||||
| import org.apache.pdfbox.rendering.PDFRenderer; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| //Required for image manipulation |  | ||||||
| import java.awt.image.BufferedImage; |  | ||||||
| import java.awt.image.BufferedImageOp; |  | ||||||
| import java.awt.image.RescaleOp; |  | ||||||
| import java.awt.image.AffineTransformOp; |  | ||||||
| import java.awt.image.ConvolveOp; |  | ||||||
| import java.awt.image.Kernel; |  | ||||||
| import java.awt.Color; |  | ||||||
| import java.awt.geom.AffineTransform; |  | ||||||
| 
 |  | ||||||
| //Required for image input/output |  | ||||||
| import javax.imageio.ImageIO; |  | ||||||
| 
 |  | ||||||
| //Required for file input/output |  | ||||||
| import java.io.File; |  | ||||||
| 
 |  | ||||||
| //Other required classes |  | ||||||
| import java.util.Random; |  | ||||||
| 
 |  | ||||||
| import io.swagger.v3.oas.annotations.Hidden; |  | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class FakeScanControllerWIP { | public class FakeScanControllerWIP { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(FakeScanControllerWIP.class); |     private static final Logger logger = LoggerFactory.getLogger(FakeScanControllerWIP.class); | ||||||
|  | |||||||
| @ -19,9 +19,11 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class MetadataController { | public class MetadataController { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -27,10 +27,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import stirling.software.SPDF.utils.ProcessExecutor; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class OCRController { | public class OCRController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(OCRController.class); |     private static final Logger logger = LoggerFactory.getLogger(OCRController.class); | ||||||
|  | |||||||
| @ -14,10 +14,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.PdfUtils; | import stirling.software.SPDF.utils.PdfUtils; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class OverlayImageController { | public class OverlayImageController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(OverlayImageController.class); |     private static final Logger logger = LoggerFactory.getLogger(OverlayImageController.class); | ||||||
|  | |||||||
| @ -16,10 +16,12 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.ProcessExecutor; | import stirling.software.SPDF.utils.ProcessExecutor; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class RepairController { | public class RepairController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(RepairController.class); |     private static final Logger logger = LoggerFactory.getLogger(RepairController.class); | ||||||
|  | |||||||
| @ -1,9 +1,35 @@ | |||||||
| package stirling.software.SPDF.controller.api.pipeline; | package stirling.software.SPDF.controller.api.pipeline; | ||||||
| 
 | 
 | ||||||
|  | import java.io.ByteArrayInputStream; | ||||||
|  | import java.io.ByteArrayOutputStream; | ||||||
|  | import java.io.File; | ||||||
|  | import java.io.IOException; | ||||||
|  | import java.io.InputStream; | ||||||
|  | import java.io.PrintStream; | ||||||
|  | import java.nio.file.Files; | ||||||
|  | import java.nio.file.Path; | ||||||
|  | import java.nio.file.Paths; | ||||||
|  | import java.time.LocalDate; | ||||||
|  | import java.time.LocalTime; | ||||||
|  | import java.time.format.DateTimeFormatter; | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.Iterator; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | import java.util.stream.Stream; | ||||||
|  | import java.util.zip.ZipEntry; | ||||||
|  | import java.util.zip.ZipInputStream; | ||||||
|  | import java.util.zip.ZipOutputStream; | ||||||
|  | 
 | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.core.io.ByteArrayResource; | import org.springframework.core.io.ByteArrayResource; | ||||||
| import org.springframework.core.io.Resource; | import org.springframework.core.io.Resource; | ||||||
| import org.springframework.http.*; | import org.springframework.http.HttpEntity; | ||||||
|  | import org.springframework.http.HttpHeaders; | ||||||
|  | import org.springframework.http.HttpMethod; | ||||||
|  | import org.springframework.http.HttpStatus; | ||||||
|  | import org.springframework.http.MediaType; | ||||||
|  | import org.springframework.http.ResponseEntity; | ||||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||||
| import org.springframework.util.LinkedMultiValueMap; | import org.springframework.util.LinkedMultiValueMap; | ||||||
| import org.springframework.util.MultiValueMap; | import org.springframework.util.MultiValueMap; | ||||||
| @ -14,35 +40,17 @@ import org.springframework.web.bind.annotation.RestController; | |||||||
| import org.springframework.web.client.RestTemplate; | import org.springframework.web.client.RestTemplate; | ||||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||||
| 
 | 
 | ||||||
| import com.fasterxml.jackson.core.JsonProcessingException; |  | ||||||
| import com.fasterxml.jackson.databind.JsonMappingException; |  | ||||||
| import com.fasterxml.jackson.databind.JsonNode; | import com.fasterxml.jackson.databind.JsonNode; | ||||||
| import com.fasterxml.jackson.databind.ObjectMapper; | import com.fasterxml.jackson.databind.ObjectMapper; | ||||||
| 
 | 
 | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.model.PipelineConfig; | import stirling.software.SPDF.model.PipelineConfig; | ||||||
| import stirling.software.SPDF.model.PipelineOperation; | import stirling.software.SPDF.model.PipelineOperation; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| 
 | 
 | ||||||
| import java.io.ByteArrayInputStream; |  | ||||||
| import java.io.ByteArrayOutputStream; |  | ||||||
| import java.io.IOException; |  | ||||||
| import java.nio.file.Files; |  | ||||||
| import java.nio.file.Path; |  | ||||||
| import java.nio.file.Paths; |  | ||||||
| import java.time.LocalDate; |  | ||||||
| import java.time.LocalTime; |  | ||||||
| import java.time.format.DateTimeFormatter; |  | ||||||
| import java.util.*; |  | ||||||
| import java.util.stream.Stream; |  | ||||||
| import java.util.zip.ZipEntry; |  | ||||||
| import java.util.zip.ZipInputStream; |  | ||||||
| import java.io.*; |  | ||||||
| import java.util.*; |  | ||||||
| import java.util.zip.ZipEntry; |  | ||||||
| import java.util.zip.ZipOutputStream; |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Pipeline", description = "Pipeline APIs") | ||||||
| public class Controller { | public class Controller { | ||||||
| 
 | 
 | ||||||
| 	@Autowired | 	@Autowired | ||||||
|  | |||||||
| @ -51,8 +51,10 @@ import com.itextpdf.signatures.SignatureUtil; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Security", description = "Security APIs") | ||||||
| public class CertSignController { | public class CertSignController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(CertSignController.class); |     private static final Logger logger = LoggerFactory.getLogger(CertSignController.class); | ||||||
|  | |||||||
| @ -17,8 +17,10 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
| import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.Schema; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Security", description = "Security APIs") | ||||||
| public class PasswordController { | public class PasswordController { | ||||||
| 
 | 
 | ||||||
|     private static final Logger logger = LoggerFactory.getLogger(PasswordController.class); |     private static final Logger logger = LoggerFactory.getLogger(PasswordController.class); | ||||||
|  | |||||||
| @ -1,8 +1,12 @@ | |||||||
| package stirling.software.SPDF.controller.api.security; | package stirling.software.SPDF.controller.api.security; | ||||||
| 
 | 
 | ||||||
| import java.awt.Color; | import java.awt.Color; | ||||||
|  | import java.io.File; | ||||||
|  | import java.io.FileOutputStream; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
|  | import java.io.InputStream; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.io.IOUtils; | ||||||
| import org.apache.pdfbox.pdmodel.PDDocument; | import org.apache.pdfbox.pdmodel.PDDocument; | ||||||
| import org.apache.pdfbox.pdmodel.PDPage; | import org.apache.pdfbox.pdmodel.PDPage; | ||||||
| import org.apache.pdfbox.pdmodel.PDPageContentStream; | import org.apache.pdfbox.pdmodel.PDPageContentStream; | ||||||
| @ -11,6 +15,7 @@ import org.apache.pdfbox.pdmodel.font.PDType0Font; | |||||||
| import org.apache.pdfbox.pdmodel.font.PDType1Font; | import org.apache.pdfbox.pdmodel.font.PDType1Font; | ||||||
| import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState; | import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState; | ||||||
| import org.apache.pdfbox.util.Matrix; | import org.apache.pdfbox.util.Matrix; | ||||||
|  | import org.springframework.core.io.ClassPathResource; | ||||||
| import org.springframework.http.ResponseEntity; | import org.springframework.http.ResponseEntity; | ||||||
| import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||||
| import org.springframework.web.bind.annotation.RequestParam; | import org.springframework.web.bind.annotation.RequestParam; | ||||||
| @ -20,19 +25,14 @@ import org.springframework.web.multipart.MultipartFile; | |||||||
| 
 | 
 | ||||||
| import com.cybozu.labs.langdetect.Detector; | import com.cybozu.labs.langdetect.Detector; | ||||||
| import com.cybozu.labs.langdetect.DetectorFactory; | import com.cybozu.labs.langdetect.DetectorFactory; | ||||||
| import com.cybozu.labs.langdetect.LangDetectException; |  | ||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
| import io.swagger.v3.oas.annotations.Parameter; | import io.swagger.v3.oas.annotations.Parameter; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| import stirling.software.SPDF.utils.WebResponseUtils; | import stirling.software.SPDF.utils.WebResponseUtils; | ||||||
| import org.springframework.core.io.ClassPathResource; |  | ||||||
| import org.apache.commons.io.IOUtils; |  | ||||||
| 
 |  | ||||||
| import java.io.InputStream; |  | ||||||
| import java.io.FileOutputStream; |  | ||||||
| import java.io.File; |  | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
|  | @Tag(name = "Security", description = "Security APIs") | ||||||
| public class WatermarkController { | public class WatermarkController { | ||||||
| 
 | 
 | ||||||
|     @PostMapping(consumes = "multipart/form-data", value = "/add-watermark") |     @PostMapping(consumes = "multipart/form-data", value = "/add-watermark") | ||||||
|  | |||||||
| @ -6,8 +6,10 @@ import org.springframework.web.bind.annotation.GetMapping; | |||||||
| import org.springframework.web.servlet.ModelAndView; | import org.springframework.web.servlet.ModelAndView; | ||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Hidden; | import io.swagger.v3.oas.annotations.Hidden; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| 
 | 
 | ||||||
| @Controller | @Controller | ||||||
|  | @Tag(name = "Convert", description = "Convert APIs") | ||||||
| public class ConverterWebController { | public class ConverterWebController { | ||||||
| 
 | 
 | ||||||
|     @GetMapping("/img-to-pdf") |     @GetMapping("/img-to-pdf") | ||||||
|  | |||||||
| @ -1,14 +1,14 @@ | |||||||
| package stirling.software.SPDF.controller.web; | package stirling.software.SPDF.controller.web; | ||||||
| 
 | 
 | ||||||
| import org.springframework.http.MediaType; |  | ||||||
| import org.springframework.stereotype.Controller; | import org.springframework.stereotype.Controller; | ||||||
| import org.springframework.ui.Model; | import org.springframework.ui.Model; | ||||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||||
| import org.springframework.web.bind.annotation.ResponseBody; |  | ||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Hidden; | import io.swagger.v3.oas.annotations.Hidden; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| 
 | 
 | ||||||
| @Controller | @Controller | ||||||
|  | @Tag(name = "General", description = "General APIs") | ||||||
| public class GeneralWebController { | public class GeneralWebController { | ||||||
| 	 @GetMapping("/pipeline") | 	 @GetMapping("/pipeline") | ||||||
| 	    @Hidden | 	    @Hidden | ||||||
| @ -23,12 +23,7 @@ public class GeneralWebController { | |||||||
|         model.addAttribute("currentPage", "merge-pdfs"); |         model.addAttribute("currentPage", "merge-pdfs"); | ||||||
|         return "merge-pdfs"; |         return "merge-pdfs"; | ||||||
|     } |     } | ||||||
|     @GetMapping("/about") |      | ||||||
|     @Hidden |  | ||||||
|     public String gameForm(Model model) { |  | ||||||
|         model.addAttribute("currentPage", "about"); |  | ||||||
|         return "about"; |  | ||||||
|     } |  | ||||||
|      |      | ||||||
|     @GetMapping("/multi-tool") |     @GetMapping("/multi-tool") | ||||||
|     @Hidden |     @Hidden | ||||||
| @ -36,17 +31,7 @@ public class GeneralWebController { | |||||||
|         model.addAttribute("currentPage", "multi-tool"); |         model.addAttribute("currentPage", "multi-tool"); | ||||||
|         return "multi-tool"; |         return "multi-tool"; | ||||||
|     } |     } | ||||||
|      |     | ||||||
|     @GetMapping("/") |  | ||||||
|     public String home(Model model) { |  | ||||||
|         model.addAttribute("currentPage", "home"); |  | ||||||
|         return "home"; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     @GetMapping("/home") |  | ||||||
|     public String root(Model model) { |  | ||||||
|         return "redirect:/"; |  | ||||||
|     } |  | ||||||
|      |      | ||||||
|     @GetMapping("/remove-pages") |     @GetMapping("/remove-pages") | ||||||
|     @Hidden |     @Hidden | ||||||
| @ -83,20 +68,4 @@ public class GeneralWebController { | |||||||
|         return "sign"; |         return "sign"; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GetMapping(value = "/robots.txt", produces = MediaType.TEXT_PLAIN_VALUE) |  | ||||||
|     @ResponseBody |  | ||||||
|     @Hidden |  | ||||||
|     public String getRobotsTxt() { |  | ||||||
|         String allowGoogleVisibility = System.getProperty("ALLOW_GOOGLE_VISIBILITY"); |  | ||||||
|         if (allowGoogleVisibility == null) |  | ||||||
|             allowGoogleVisibility = System.getenv("ALLOW_GOOGLE_VISIBILITY"); |  | ||||||
|         if (allowGoogleVisibility == null) |  | ||||||
|             allowGoogleVisibility = "false"; |  | ||||||
|         if (Boolean.parseBoolean(allowGoogleVisibility)) { |  | ||||||
|             return "User-agent: Googlebot\nAllow: /\n\nUser-agent: *\nAllow: /"; |  | ||||||
|         } else { |  | ||||||
|             return "User-agent: Googlebot\nDisallow: /\n\nUser-agent: *\nDisallow: /"; |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|      |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,52 @@ | |||||||
|  | package stirling.software.SPDF.controller.web; | ||||||
|  | 
 | ||||||
|  | import org.springframework.http.MediaType; | ||||||
|  | import org.springframework.stereotype.Controller; | ||||||
|  | import org.springframework.ui.Model; | ||||||
|  | import org.springframework.web.bind.annotation.GetMapping; | ||||||
|  | import org.springframework.web.bind.annotation.ResponseBody; | ||||||
|  | 
 | ||||||
|  | import io.swagger.v3.oas.annotations.Hidden; | ||||||
|  | 
 | ||||||
|  | @Controller | ||||||
|  | public class HomeWebController { | ||||||
|  | 	  | ||||||
|  |     @GetMapping("/about") | ||||||
|  |     @Hidden | ||||||
|  |     public String gameForm(Model model) { | ||||||
|  |         model.addAttribute("currentPage", "about"); | ||||||
|  |         return "about"; | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     | ||||||
|  |      | ||||||
|  |     @GetMapping("/") | ||||||
|  |     public String home(Model model) { | ||||||
|  |         model.addAttribute("currentPage", "home"); | ||||||
|  |         return "home"; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @GetMapping("/home") | ||||||
|  |     public String root(Model model) { | ||||||
|  |         return "redirect:/"; | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     | ||||||
|  | 
 | ||||||
|  |     @GetMapping(value = "/robots.txt", produces = MediaType.TEXT_PLAIN_VALUE) | ||||||
|  |     @ResponseBody | ||||||
|  |     @Hidden | ||||||
|  |     public String getRobotsTxt() { | ||||||
|  |         String allowGoogleVisibility = System.getProperty("ALLOW_GOOGLE_VISIBILITY"); | ||||||
|  |         if (allowGoogleVisibility == null) | ||||||
|  |             allowGoogleVisibility = System.getenv("ALLOW_GOOGLE_VISIBILITY"); | ||||||
|  |         if (allowGoogleVisibility == null) | ||||||
|  |             allowGoogleVisibility = "false"; | ||||||
|  |         if (Boolean.parseBoolean(allowGoogleVisibility)) { | ||||||
|  |             return "User-agent: Googlebot\nAllow: /\n\nUser-agent: *\nAllow: /"; | ||||||
|  |         } else { | ||||||
|  |             return "User-agent: Googlebot\nDisallow: /\n\nUser-agent: *\nDisallow: /"; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |      | ||||||
|  | } | ||||||
| @ -12,9 +12,11 @@ import io.micrometer.core.instrument.Counter; | |||||||
| import io.micrometer.core.instrument.Meter; | import io.micrometer.core.instrument.Meter; | ||||||
| import io.micrometer.core.instrument.MeterRegistry; | import io.micrometer.core.instrument.MeterRegistry; | ||||||
| import io.swagger.v3.oas.annotations.Operation; | import io.swagger.v3.oas.annotations.Operation; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| 
 | 
 | ||||||
| @RestController | @RestController | ||||||
| @RequestMapping("/api/v1") | @RequestMapping("/api/v1") | ||||||
|  | @Tag(name = "API", description = "Info APIs") | ||||||
| public class MetricsController { | public class MetricsController { | ||||||
| 
 | 
 | ||||||
|     private final MeterRegistry meterRegistry; |     private final MeterRegistry meterRegistry; | ||||||
|  | |||||||
| @ -12,8 +12,10 @@ import org.springframework.web.bind.annotation.GetMapping; | |||||||
| import org.springframework.web.servlet.ModelAndView; | import org.springframework.web.servlet.ModelAndView; | ||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Hidden; | import io.swagger.v3.oas.annotations.Hidden; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| 
 | 
 | ||||||
| @Controller | @Controller | ||||||
|  | @Tag(name = "Other", description = "Other APIs") | ||||||
| public class OtherWebController { | public class OtherWebController { | ||||||
|     @GetMapping("/compress-pdf") |     @GetMapping("/compress-pdf") | ||||||
|     @Hidden |     @Hidden | ||||||
|  | |||||||
| @ -5,8 +5,10 @@ import org.springframework.ui.Model; | |||||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||||
| 
 | 
 | ||||||
| import io.swagger.v3.oas.annotations.Hidden; | import io.swagger.v3.oas.annotations.Hidden; | ||||||
|  | import io.swagger.v3.oas.annotations.tags.Tag; | ||||||
| 
 | 
 | ||||||
| @Controller | @Controller | ||||||
|  | @Tag(name = "Security", description = "Security APIs") | ||||||
| public class SecurityWebController { | public class SecurityWebController { | ||||||
|     @GetMapping("/add-password") |     @GetMapping("/add-password") | ||||||
|     @Hidden |     @Hidden | ||||||
|  | |||||||
| @ -1,8 +1,7 @@ | |||||||
| package stirling.software.SPDF.model; | package stirling.software.SPDF.model; | ||||||
| import com.fasterxml.jackson.annotation.JsonProperty; |  | ||||||
| 
 |  | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.Map; | 
 | ||||||
|  | import com.fasterxml.jackson.annotation.JsonProperty; | ||||||
| 
 | 
 | ||||||
| public class PipelineConfig { | public class PipelineConfig { | ||||||
|     private String name; |     private String name; | ||||||
|  | |||||||
| @ -1,12 +1,12 @@ | |||||||
| spring.http.multipart.max-file-size=2GB | spring.http.multipart.max-file-size=${MAX_FILE_SIZE:2000MB} | ||||||
| spring.http.multipart.max-request-size=2GB | spring.http.multipart.max-request-size=${MAX_FILE_SIZE:2000MB} | ||||||
| 
 | 
 | ||||||
| multipart.enabled=true | multipart.enabled=true | ||||||
| multipart.max-file-size=2000MB | multipart.max-file-size=${MAX_FILE_SIZE:2000MB} | ||||||
| multipart.max-request-size=2000MB | multipart.max-request-size=${MAX_FILE_SIZE:2000MB} | ||||||
| 
 | 
 | ||||||
| spring.servlet.multipart.max-file-size=2000MB | spring.servlet.multipart.max-file-size=${MAX_FILE_SIZE:2000MB} | ||||||
| spring.servlet.multipart.max-request-size=2000MB | spring.servlet.multipart.max-request-size=${MAX_FILE_SIZE:2000MB} | ||||||
| 
 | 
 | ||||||
| server.forward-headers-strategy=NATIVE | server.forward-headers-strategy=NATIVE | ||||||
| 
 | 
 | ||||||
| @ -22,7 +22,7 @@ server.servlet.context-path=${APP_ROOT_PATH:/} | |||||||
| spring.devtools.restart.enabled=true | spring.devtools.restart.enabled=true | ||||||
| spring.devtools.livereload.enabled=true | spring.devtools.livereload.enabled=true | ||||||
| 
 | 
 | ||||||
| spring.thymeleaf.encoding=UTF-8 | spring.thymeleaf.encoding=UTF-8  | ||||||
| 
 | 
 | ||||||
| server.connection-timeout=${CONNECTION_TIMEOUT:5m} | server.connection-timeout=${CONNECTION_TIMEOUT:5m} | ||||||
| spring.mvc.async.request-timeout=${ASYNC_CONNECTION_TIMEOUT:300000} | spring.mvc.async.request-timeout=${ASYNC_CONNECTION_TIMEOUT:300000} | ||||||
|  | |||||||
| @ -122,13 +122,17 @@ fetch('v3/api-docs') | |||||||
| 	.then(data => { | 	.then(data => { | ||||||
| 		apiDocs = data.paths; | 		apiDocs = data.paths; | ||||||
| 		let operationsDropdown = document.getElementById('operationsDropdown'); | 		let operationsDropdown = document.getElementById('operationsDropdown'); | ||||||
| 
 | 		const ignoreOperations = ["operationToIgnore", "operationToIgnore"]; // Add the operations you want to ignore here
 | ||||||
|  | 				 | ||||||
| 		operationsDropdown.innerHTML = ''; | 		operationsDropdown.innerHTML = ''; | ||||||
| 
 | 
 | ||||||
| 		Object.keys(apiDocs).forEach(operation => { | 		Object.keys(apiDocs).forEach(operation => { | ||||||
| 			if (apiDocs[operation].hasOwnProperty('post')) { | 			if (apiDocs[operation].hasOwnProperty('post')&& !ignoreOperations.includes(operation)) { | ||||||
|  | 				 | ||||||
| 				let option = document.createElement('option'); | 				let option = document.createElement('option'); | ||||||
| 				option.textContent = operation; | 				let operationWithoutSlash = operation.replace(/\//g, ''); // Remove slashes
 | ||||||
|  | 				option.textContent = operationWithoutSlash; | ||||||
|  | 				option.value = operation; // Keep the value with slashes for querying
 | ||||||
| 				operationsDropdown.appendChild(option); | 				operationsDropdown.appendChild(option); | ||||||
| 			} | 			} | ||||||
| 		}); | 		}); | ||||||
|  | |||||||
| @ -14,13 +14,11 @@ | |||||||
| 					<div class="col-md-6"> | 					<div class="col-md-6"> | ||||||
| 
 | 
 | ||||||
| 						<div class="mb-3"> | 						<div class="mb-3"> | ||||||
| 							<button id="savePipelineBtn" class="btn btn-success">Save | 							<button id="savePipelineBtn" class="btn btn-success">Download</button> | ||||||
| 								Pipeline Configuration</button> | 
 | ||||||
| 								 | 							<button id="validateButton" class="btn btn-success">Validate</button> | ||||||
| 								<button id="validateButton" class="btn btn-success">Validate</button> |  | ||||||
| 							<div class="btn-group"> | 							<div class="btn-group"> | ||||||
| 								<button id="uploadPipelineBtn" class="btn btn-primary">Upload | 								<button id="uploadPipelineBtn" class="btn btn-primary">Upload</button> | ||||||
| 									Pipeline Configuration</button> |  | ||||||
| 								<input type="file" id="uploadPipelineInput" accept=".json" | 								<input type="file" id="uploadPipelineInput" accept=".json" | ||||||
| 									style="display: none;"> | 									style="display: none;"> | ||||||
| 							</div> | 							</div> | ||||||
| @ -41,19 +39,18 @@ | |||||||
| 									</select> | 									</select> | ||||||
| 								</div> | 								</div> | ||||||
| 								<div class="mb-3"> | 								<div class="mb-3"> | ||||||
| 									<button id="addOperationBtn" class="btn btn-primary">Add | 									<button id="addOperationBtn" class="btn btn-primary">Add operation</button> | ||||||
| 										operation to pipeline</button> |  | ||||||
| 								</div> | 								</div> | ||||||
| 								<h3>Pipeline:</h3> | 								<h3>Pipeline:</h3> | ||||||
| 								<ol id="pipelineList" class="list-group"> | 								<ol id="pipelineList" class="list-group"> | ||||||
| 									<!-- Pipeline operations will be dynamically populated here --> | 									<!-- Pipeline operations will be dynamically populated here --> | ||||||
| 								</ol> | 								</ol> | ||||||
| 							</div> | 							</div> | ||||||
| 							 | 
 | ||||||
| 							<input type="file" id="fileInput" multiple> | 							<input type="file" id="fileInput" multiple> | ||||||
| 							 | 
 | ||||||
| 							<button class="btn btn-primary" id="submitConfigBtn">Submit</button> | 							<button class="btn btn-primary" id="submitConfigBtn">Submit</button> | ||||||
| 							 | 
 | ||||||
| 
 | 
 | ||||||
| 						</div> | 						</div> | ||||||
| 
 | 
 | ||||||
| @ -70,11 +67,11 @@ | |||||||
| 							</div> | 							</div> | ||||||
| 							<script src="js/pipeline.js"></script> | 							<script src="js/pipeline.js"></script> | ||||||
| 						</div> | 						</div> | ||||||
| 						</div> | 					</div> | ||||||
| 						</div> | 				</div> | ||||||
| 						</div> | 			</div> | ||||||
| 						</div> | 		</div> | ||||||
| 						<style> | 		<style> | ||||||
| .modal { | .modal { | ||||||
| 	display: none; /* Hidden by default */ | 	display: none; /* Hidden by default */ | ||||||
| 	position: fixed; /* Stay in place */ | 	position: fixed; /* Stay in place */ | ||||||
| @ -107,8 +104,8 @@ | |||||||
| 	flex-direction: column; | 	flex-direction: column; | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|     <div th:insert="~{fragments/footer.html :: footer}"></div> | 		<div th:insert="~{fragments/footer.html :: footer}"></div> | ||||||
| </div> | 	</div> | ||||||
| 
 | 
 | ||||||
| </body> | </body> | ||||||
| </html> | </html> | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user