@Test public void testCountLines() throws IOException { logger.debug("testCountLines: enter"); final int returnValue = ParseLog.countLines(testFile1); logger.debug("testCountLines: returnValue: " + returnValue); assertEquals(12, returnValue); logger.debug("testCountLines: exit"); }
public static int countLines(final String filename) { int cnt = 0; try (FileReader freader = new FileReader(filename); LineNumberReader reader = new LineNumberReader(freader)) { String line = null; while ((line = reader.readLine()) != null) { logger.debug("Reading the Logs" + line); } cnt = reader.getLineNumber(); logger.info("Line number:" + cnt); reader.close(); freader.close(); } catch (final Exception e) { logger.error(e); } return cnt; }
ParseLog { public static int countLines(final String filename) { int cnt = 0; try (FileReader freader = new FileReader(filename); LineNumberReader reader = new LineNumberReader(freader)) { String line = null; while ((line = reader.readLine()) != null) { logger.debug("Reading the Logs" + line); } cnt = reader.getLineNumber(); logger.info("Line number:" + cnt); reader.close(); freader.close(); } catch (final Exception e) { logger.error(e); } return cnt; } }
ParseLog { public static int countLines(final String filename) { int cnt = 0; try (FileReader freader = new FileReader(filename); LineNumberReader reader = new LineNumberReader(freader)) { String line = null; while ((line = reader.readLine()) != null) { logger.debug("Reading the Logs" + line); } cnt = reader.getLineNumber(); logger.info("Line number:" + cnt); reader.close(); freader.close(); } catch (final Exception e) { logger.error(e); } return cnt; }  }
ParseLog { public static int countLines(final String filename) { int cnt = 0; try (FileReader freader = new FileReader(filename); LineNumberReader reader = new LineNumberReader(freader)) { String line = null; while ((line = reader.readLine()) != null) { logger.debug("Reading the Logs" + line); } cnt = reader.getLineNumber(); logger.info("Line number:" + cnt); reader.close(); freader.close(); } catch (final Exception e) { logger.error(e); } return cnt; }  static void main(final String[] args); static int countLines(final String filename); static String pullLastLineRead(final File file, final String dataFileName); static LogEntryObject pullOutLogValues(final String line, final String type); static void process(final String line, final String type, final LogType logFile); static Date parseDate(final String dateline, final String pattern, final boolean singleSplit); static String parseRemoteSystem(final String line); static String[] getPaths(final String logPath); static Properties getPropertiesValue(final String fileName); static Connection getDbConnection(); }
ParseLog { public static int countLines(final String filename) { int cnt = 0; try (FileReader freader = new FileReader(filename); LineNumberReader reader = new LineNumberReader(freader)) { String line = null; while ((line = reader.readLine()) != null) { logger.debug("Reading the Logs" + line); } cnt = reader.getLineNumber(); logger.info("Line number:" + cnt); reader.close(); freader.close(); } catch (final Exception e) { logger.error(e); } return cnt; }  static void main(final String[] args); static int countLines(final String filename); static String pullLastLineRead(final File file, final String dataFileName); static LogEntryObject pullOutLogValues(final String line, final String type); static void process(final String line, final String type, final LogType logFile); static Date parseDate(final String dateline, final String pattern, final boolean singleSplit); static String parseRemoteSystem(final String line); static String[] getPaths(final String logPath); static Properties getPropertiesValue(final String fileName); static Connection getDbConnection();  }