summaryrefslogtreecommitdiff
path: root/dslog/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'dslog/Main.java')
-rw-r--r--dslog/Main.java63
1 files changed, 1 insertions, 62 deletions
diff --git a/dslog/Main.java b/dslog/Main.java
index b6c6a01..0c95c50 100644
--- a/dslog/Main.java
+++ b/dslog/Main.java
@@ -20,71 +20,10 @@ class Main {
}
}
- public static class LogSet {
- public String name;
- public String dslog = "␕";
- public String dsevents = "␕";
- public String pdplog = "␕";
-
- public String toString() {
- return name+" "+dslog+"/"+dsevents+"/"+pdplog;
- }
- }
-
- private static LogSet getSet(Map<String, LogSet> sets, String name) {
- LogSet set;
- synchronized (sets) {
- set = sets.get(name);
- if (set == null) {
- set = new LogSet();
- set.name = name;
- sets.put(name, set);
- }
- }
- return set;
- }
public static void main(String[] args) throws IOException {
for (String dirname : args) {
- SortedMap<String, LogSet> logsets = new TreeMap<String, LogSet>();
- List<Exception> errs = new ArrayList<Exception>();
- Files.list(Paths.get(dirname)).parallel().forEach(filepath->{
- try {
- String filename = filepath.getFileName().toString();
- if (filename.endsWith(".dslog")) {
- String setname = filename.substring(0, filename.lastIndexOf('.'));
- try (DslogReader dslog = new DslogReader(Files.newInputStream(filepath))) {
- getSet(logsets, setname).dslog = ""+dslog.version;
- } catch (Exception e) {
- getSet(logsets, setname).pdplog = "☠";
- throw e;
- }
- } else if (filename.endsWith(".dsevents")) {
- String setname = filename.substring(0, filename.lastIndexOf('.'));
- try (DseventsReader dsevents = new DseventsReader(Files.newInputStream(filepath))) {
- getSet(logsets, setname).dsevents = ""+dsevents.version;
- } catch (Exception e) {
- getSet(logsets, setname).pdplog = "☠";
- throw e;
- }
- } else if (filename.endsWith(".pdplog")) {
- String setname = filename.substring(0, filename.lastIndexOf('.'));
- try (PdplogReader pdplog = new PdplogReader(Files.newInputStream(filepath))) {
- getSet(logsets, setname).pdplog = ""+pdplog.version;
- } catch (Exception e) {
- getSet(logsets, setname).pdplog = "☠";
- throw e;
- }
- }
- } catch (Exception e) {
- e = new IOException("Could not read file: "+filepath.toString(), e);
- synchronized (errs) {
- errs.add(e);
- }
- e.printStackTrace();
- }
- });
- logsets.forEach((k,v)->{
+ Logdir.opendir(dirname).forEach((k,v)->{
System.out.println(v);
});
}