@Test void fileNotFoundFromRecordFileParser() { fileCopier.copy(); RecordParserProperties mockParserProperties = Mockito.mock(RecordParserProperties.class); doReturn(Path.of("/var/folders/tmp")).when(mockParserProperties).getValidPath(); recordFilePoller = new RecordFilePoller(mockParserProperties, recordFileParser); recordFilePoller.poll(); assertValidFiles(); }
@Override @Scheduled(fixedDelayString = "${hedera.mirror.importer.parser.record.frequency:100}") public void poll() { if (ShutdownHelper.isStopping()) { return; } Path path = parserProperties.getValidPath(); log.debug("Parsing record files from {}", path); try { File file = path.toFile(); if (file.isDirectory()) { String[] files = file.list(); if (files == null || files.length == 0) { log.debug("No files to parse in directory {}", file.getPath()); return; } Arrays.sort(files); log.trace("Processing record files: {}", files); loadRecordFiles(files); } else { log.error("Input parameter is not a folder: {}", path); } } catch (Exception e) { log.error("Error parsing files", e); } }
RecordFilePoller implements FilePoller { @Override @Scheduled(fixedDelayString = "${hedera.mirror.importer.parser.record.frequency:100}") public void poll() { if (ShutdownHelper.isStopping()) { return; } Path path = parserProperties.getValidPath(); log.debug("Parsing record files from {}", path); try { File file = path.toFile(); if (file.isDirectory()) { String[] files = file.list(); if (files == null || files.length == 0) { log.debug("No files to parse in directory {}", file.getPath()); return; } Arrays.sort(files); log.trace("Processing record files: {}", files); loadRecordFiles(files); } else { log.error("Input parameter is not a folder: {}", path); } } catch (Exception e) { log.error("Error parsing files", e); } } }
RecordFilePoller implements FilePoller { @Override @Scheduled(fixedDelayString = "${hedera.mirror.importer.parser.record.frequency:100}") public void poll() { if (ShutdownHelper.isStopping()) { return; } Path path = parserProperties.getValidPath(); log.debug("Parsing record files from {}", path); try { File file = path.toFile(); if (file.isDirectory()) { String[] files = file.list(); if (files == null || files.length == 0) { log.debug("No files to parse in directory {}", file.getPath()); return; } Arrays.sort(files); log.trace("Processing record files: {}", files); loadRecordFiles(files); } else { log.error("Input parameter is not a folder: {}", path); } } catch (Exception e) { log.error("Error parsing files", e); } }  }
RecordFilePoller implements FilePoller { @Override @Scheduled(fixedDelayString = "${hedera.mirror.importer.parser.record.frequency:100}") public void poll() { if (ShutdownHelper.isStopping()) { return; } Path path = parserProperties.getValidPath(); log.debug("Parsing record files from {}", path); try { File file = path.toFile(); if (file.isDirectory()) { String[] files = file.list(); if (files == null || files.length == 0) { log.debug("No files to parse in directory {}", file.getPath()); return; } Arrays.sort(files); log.trace("Processing record files: {}", files); loadRecordFiles(files); } else { log.error("Input parameter is not a folder: {}", path); } } catch (Exception e) { log.error("Error parsing files", e); } }  @Override @Scheduled(fixedDelayString = "${hedera.mirror.importer.parser.record.frequency:100}") void poll(); }
RecordFilePoller implements FilePoller { @Override @Scheduled(fixedDelayString = "${hedera.mirror.importer.parser.record.frequency:100}") public void poll() { if (ShutdownHelper.isStopping()) { return; } Path path = parserProperties.getValidPath(); log.debug("Parsing record files from {}", path); try { File file = path.toFile(); if (file.isDirectory()) { String[] files = file.list(); if (files == null || files.length == 0) { log.debug("No files to parse in directory {}", file.getPath()); return; } Arrays.sort(files); log.trace("Processing record files: {}", files); loadRecordFiles(files); } else { log.error("Input parameter is not a folder: {}", path); } } catch (Exception e) { log.error("Error parsing files", e); } }  @Override @Scheduled(fixedDelayString = "${hedera.mirror.importer.parser.record.frequency:100}") void poll();  }