[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [ernie/master] Don't break when reading corrupt file.
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Fri, 26 Feb 2010 08:37:48 +0100
Subject: Don't break when reading corrupt file.
Commit: ef968f13ea068790f45d3018b49636fb177d6e1d
---
src/TorperfProcessor.java | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/TorperfProcessor.java b/src/TorperfProcessor.java
index 3278124..b7ac752 100644
--- a/src/TorperfProcessor.java
+++ b/src/TorperfProcessor.java
@@ -18,6 +18,11 @@ public class TorperfProcessor {
BufferedReader br = new BufferedReader(new FileReader(rawFile));
String line = br.readLine(); // ignore header
while ((line = br.readLine()) != null) {
+ if (line.split(",").length != 4) {
+ logger.warning("Corrupt line in " + statsDirectory
+ + "/torperf-raw!");
+ break;
+ }
String key = line.substring(0, line.lastIndexOf(","));
rawObs.put(key, line);
}
--
1.6.5