diff --git a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java index 39428104..2cf967df 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java +++ b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java @@ -409,10 +409,10 @@ private static int commonPrefixLength(String s1, String s2) private static boolean hasRequiredHeaders(Path diannReportTsv) { - try + try (Stream lines = Files.lines(diannReportTsv)) { // Read the first line of the file - String firstLine = Files.lines(diannReportTsv).findFirst().orElse(""); + String firstLine = lines.findFirst().orElse(""); // Check if the first line has the expected header columns names return List.of(firstLine.trim().split("\t")).containsAll(LibSourceFile.DIANN_REPORT_EXPECTED_HEADERS); }