diff options
author | ITSERVICES\rb7147 <rb7147@att.com> | 2017-04-25 11:46:00 -0400 |
---|---|---|
committer | ITSERVICES\rb7147 <rb7147@att.com> | 2017-05-03 09:58:17 -0400 |
commit | e0addf5b588a1244f9679becd90999dfcb4c3a94 (patch) | |
tree | 1212772d6366730266ff0e093c874b07aa716c29 /LogParser/src/main/java | |
parent | 39fb0f30472777e4b60d6a7ac8aa4eb9773961ff (diff) |
Policy 1707 commit to LF
Change-Id: Ibe6f01d92f9a434c040abb05d5386e89d675ae65
Signed-off-by: ITSERVICES\rb7147 <rb7147@att.com>
Diffstat (limited to 'LogParser/src/main/java')
-rw-r--r-- | LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java b/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java index 5303bacc2..73266603b 100644 --- a/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java +++ b/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java @@ -44,11 +44,10 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Stream; +import org.apache.log4j.Logger; import org.openecomp.policy.common.im.AdministrativeStateException; import org.openecomp.policy.common.im.IntegrityMonitor; import org.openecomp.policy.common.im.StandbyStatusException; - -import org.apache.log4j.Logger; import org.openecomp.xacml.parser.LogEntryObject.LOGTYPE; /** @@ -75,6 +74,8 @@ public class ParseLog { private static String resourceName; private static long sleepTimer = 50000; static IntegrityMonitor im; + + private static RandomAccessFile randomAccessFile; public static void main(String[] args) throws Exception { @@ -143,9 +144,7 @@ public class ParseLog { public static int countLines(String filename) throws IOException { LineNumberReader reader = new LineNumberReader(new FileReader(filename)); int cnt = 0; - String lineRead = ""; - while ((lineRead = reader.readLine()) != null) {} - + while ((reader.readLine()) != null) {} cnt = reader.getLineNumber(); reader.close(); return cnt; @@ -156,8 +155,7 @@ public class ParseLog { file.createNewFile(); return null; } - RandomAccessFile randomAccessFile = new RandomAccessFile(file, "r"); - int lines = 0; + randomAccessFile = new RandomAccessFile(file, "r"); StringBuilder builder = new StringBuilder(); long length = file.length(); length--; @@ -172,9 +170,7 @@ public class ParseLog { String[] parseString = builder.toString().split("Last line Read:"); String returnValue = parseString[1].replace("\r", ""); return returnValue.trim(); - //return parseString[2].replace("\r", ""); } - lines++; builder = null; builder = new StringBuilder(); } |