Mercurial > hg4j
annotate src/org/tmatesoft/hg/internal/LineReader.java @ 480:f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 17 Jul 2012 22:14:21 +0200 |
parents | |
children | e31e85cf4d4c |
rev | line source |
---|---|
480
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 /* |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012 TMate Software Ltd |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
3 * |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 * the Free Software Foundation; version 2 of the License. |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 * |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 * |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 * For information on how to redistribute this software under |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 * the terms of a license other than GNU General Public License |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 * contact TMate Software at support@hg4j.com |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 */ |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
17 package org.tmatesoft.hg.internal; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
19 import static org.tmatesoft.hg.util.LogFacility.Severity.Warn; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
20 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
21 import java.io.BufferedReader; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
22 import java.io.File; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 import java.io.FileReader; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 import java.io.IOException; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 import java.util.Collection; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
27 import org.tmatesoft.hg.repo.HgInvalidFileException; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 import org.tmatesoft.hg.repo.ext.MqManager; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
29 import org.tmatesoft.hg.util.LogFacility; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
30 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
31 /** |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 * Handy class to read line-based configuration files |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
33 * |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
34 * @author Artem Tikhomirov |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
35 * @author TMate Software Ltd. |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
36 */ |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
37 public final class LineReader { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
38 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
39 public interface LineConsumer<T> { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
40 // boolean begin(File f, T paramObj) throws IOException; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
41 boolean consume(String line, T paramObj) throws IOException; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
42 // boolean end(File f, T paramObj) throws IOException; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
43 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
44 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
45 public static class SimpleLineCollector implements LineReader.LineConsumer<Collection<String>> { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
46 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
47 public boolean consume(String line, Collection<String> result) throws IOException { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
48 result.add(line); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
49 return true; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
50 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
51 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
52 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
53 private final File file; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
54 private final LogFacility log; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
55 private boolean trimLines = true; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
56 private boolean skipEmpty = true; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
57 private String ignoreThatStarts = null; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
58 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
59 public LineReader(File f, LogFacility logFacility) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
60 file = f; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
61 log = logFacility; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
62 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
63 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
64 /** |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
65 * default: <code>true</code> |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
66 * <code>false</code> to return line as is |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
67 */ |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
68 public LineReader trimLines(boolean trim) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
69 trimLines = trim; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
70 return this; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
71 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
72 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
73 /** |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
74 * default: <code>true</code> |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
75 * <code>false</code> to pass empty lines to consumer |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
76 */ |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
77 public LineReader skipEmpty(boolean skip) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
78 skipEmpty = skip; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
79 return this; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
80 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
81 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
82 /** |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
83 * default: doesn't skip any line. |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
84 * set e.g. to "#" or "//" to skip lines that start with such prefix |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
85 */ |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
86 public LineReader ignoreLineComments(String lineStart) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
87 ignoreThatStarts = lineStart; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
88 return this; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
89 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
90 |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
91 public <T> void read(LineConsumer<T> consumer, T paramObj) throws HgInvalidFileException { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
92 BufferedReader statusFileReader = null; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
93 try { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
94 // consumer.begin(file, paramObj); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
95 statusFileReader = new BufferedReader(new FileReader(file)); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
96 String line; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
97 boolean ok = true; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
98 while (ok && (line = statusFileReader.readLine()) != null) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
99 if (trimLines) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
100 line = line.trim(); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
101 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
102 if (ignoreThatStarts != null && line.startsWith(ignoreThatStarts)) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
103 continue; |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
104 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
105 if (!skipEmpty || line.length() > 0) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
106 ok = consumer.consume(line, paramObj); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
107 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
108 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
109 } catch (IOException ex) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
110 throw new HgInvalidFileException(ex.getMessage(), ex, file); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
111 } finally { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
112 try { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
113 statusFileReader.close(); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
114 } catch (IOException ex) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
115 log.dump(MqManager.class, Warn, ex, null); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
116 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
117 // try { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
118 // consumer.end(file, paramObj); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
119 // } catch (IOException ex) { |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
120 // log.warn(MqManager.class, ex, null); |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
121 // } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
122 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
123 } |
f3fab7a20841
Refactor LineReader utility as stanalone class to facilitate reuse
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
124 } |