Package com.shaft.tools.io
Class PdfFileManager
java.lang.Object
com.shaft.tools.io.PdfFileManager
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPdfFileManager
(String pdfFilePath) PdfFileManager
(String folderName, String fileName, int numberOfRetries) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
readFileContent
(String relativeFilePath, boolean... deleteFileAfterReading) Read PDF file content given relative path and optionally delete the file after reading itreadPDFContentFromDownloadedPDF
(int startPageNumber, int endPageNumber, PdfFileManager.DeleteFileAfterValidationStatus deleteFileAfterValidationStatus) readPDFContentFromDownloadedPDF
(PdfFileManager.DeleteFileAfterValidationStatus deleteFileAfterValidationStatus)
-
Constructor Details
-
PdfFileManager
-
PdfFileManager
-
-
Method Details
-
readFileContent
Read PDF file content given relative path and optionally delete the file after reading it- Parameters:
relativeFilePath
- relative path to the PDF filedeleteFileAfterReading
- optional boolean to delete the file after reading it or not, default is to leave the file as is- Returns:
- a string value representing the entire content of the pdf file
-
readFileContent
-
readPDFContentFromDownloadedPDF
public String readPDFContentFromDownloadedPDF(int startPageNumber, int endPageNumber, PdfFileManager.DeleteFileAfterValidationStatus deleteFileAfterValidationStatus) - Parameters:
startPageNumber
- the starting page for the document to be validatedendPageNumber
- the ending page for the document to be validateddeleteFileAfterValidationStatus
- the status of deleting the file after get the document text- Returns:
- returns the pdf content in string so that can be validated
-
readPDFContentFromDownloadedPDF
public String readPDFContentFromDownloadedPDF(PdfFileManager.DeleteFileAfterValidationStatus deleteFileAfterValidationStatus)
-