boolean (@NotNull Path storageFilePath) { Path recordsFile = storageFilePath.getParent().resolve(storageFilePath.getFileName() + INDEX_EXTENSION); Path dataFile = storageFilePath.getParent().resolve(storageFilePath.getFileName() + DATA_EXTENSION); // ensure both files deleted boolean deletedRecordsFile = false; try { deletedRecordsFile = Files.deleteIfExists(recordsFile); } catch (IOException ignore) { } boolean deletedDataFile = false; try { deletedDataFile = Files.deleteIfExists(dataFile); } catch (IOException ignore) { } return deletedRecordsFile && deletedDataFile; }