Skip to content

Commit 11e3991

Browse files
committed
some other simplifications here and there
1 parent bb386b5 commit 11e3991

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎src/main/java/com/mindee/input/LocalInputSource.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public LocalInputSource(InputStream file, String filename) throws IOException {
3030
}
3131

3232
public LocalInputSource(String filePath) throws IOException {
33-
File file = new File(filePath);
33+
var file = new File(filePath);
3434
this.file = Files.readAllBytes(file.toPath());
3535
this.filename = file.getName();
3636
}
@@ -57,7 +57,7 @@ public LocalInputSource(String fileAsBase64, String filename) {
5757

5858
/**
5959
* Get the number of pages in the document.
60-
*
60+
*
6161
* @return the number of pages in the current file.
6262
* @throws IOException If an I/O error occurs during the PDF operation.
6363
*/

‎src/main/java/com/mindee/input/PageOptionsOperation.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
*/
66
public enum PageOptionsOperation {
77
/**
8-
* Keep only the specified pages, and remove all others.
8+
* Keep only the specified pages, removing all others.
99
*/
1010
KEEP_ONLY,
1111
/**
12-
* Remove the specified pages, and keep all others.
12+
* Remove the specified pages, keeping all others.
1313
*/
1414
REMOVE
1515
}

‎src/main/java/com/mindee/parsing/SummaryHelper.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static String formatForDisplay(Boolean inputValue, Integer maxColSize) {
7272
* Format an rST table line separator.
7373
*/
7474
public static String lineSeparator(int[] columnSizes, String str) {
75-
StringBuilder outStr = new StringBuilder(" +");
75+
var outStr = new StringBuilder(" +");
7676
for (int size : columnSizes) {
7777
outStr.append(String.format("%" + size + "s+", "").replace(" ", str));
7878
}

‎src/main/java/com/mindee/pdf/ExtractedPDF.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import java.io.ByteArrayOutputStream;
55
import java.io.File;
66
import java.io.IOException;
7-
import java.nio.file.Path;
87
import java.nio.file.Paths;
98
import lombok.Getter;
109
import org.apache.pdfbox.pdmodel.PDDocument;
@@ -35,8 +34,8 @@ public ExtractedPDF(PDDocument pdf, String filename) {
3534
* @throws IOException Throws if the file can't be accessed.
3635
*/
3736
public void writeToFile(String outputPath) throws IOException {
38-
Path pdfPath = Paths.get(outputPath, this.filename);
39-
File outputfile = new File(pdfPath.toString());
37+
var pdfPath = Paths.get(outputPath, this.filename);
38+
var outputfile = new File(pdfPath.toString());
4039
this.pdf.save(outputfile);
4140
}
4241

@@ -47,7 +46,7 @@ public void writeToFile(String outputPath) throws IOException {
4746
* @throws IOException Throws if the file can't be accessed.
4847
*/
4948
public LocalInputSource asInputSource() throws IOException {
50-
ByteArrayOutputStream output = new ByteArrayOutputStream();
49+
var output = new ByteArrayOutputStream();
5150
this.pdf.save(output);
5251
return new LocalInputSource(output.toByteArray(), this.filename);
5352
}

0 commit comments

Comments
 (0)