diff options
Diffstat (limited to 'cadi/core/src')
-rw-r--r-- | cadi/core/src/main/java/org/onap/aaf/cadi/User.java | 2 | ||||
-rw-r--r-- | cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/User.java b/cadi/core/src/main/java/org/onap/aaf/cadi/User.java index 4848e504..cb3b4e8f 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/User.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/User.java @@ -40,7 +40,7 @@ public final class User<PERM extends Permission> { public String name; private byte[] cred; public Principal principal; - Map<String, Permission> perms ; + Map<String, Permission> perms; long permExpires; private final long interval; int count; diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java b/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java index fbaa4a5a..2c9bb8c4 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java @@ -45,17 +45,20 @@ public class CSV { private Access access; private boolean processAll; private char delimiter = ','; + private boolean go; public CSV(Access access, File file) { this.access = access; csv = file; processAll = false; + go = true; } public CSV(Access access, String csvFilename) { this.access = access; csv = new File(csvFilename); processAll = false; + go = true; } public CSV setDelimiter(char delimiter) { @@ -88,7 +91,7 @@ public class CSV { try { String line; StringBuilder sb = new StringBuilder(); - while((line = br.readLine())!=null) { + while(go && (line = br.readLine())!=null) { line=line.trim(); if(!line.startsWith("#") && line.length()>0) { // System.out.println(line); uncomment to debug @@ -268,6 +271,13 @@ public class CSV { return csv.getAbsolutePath(); } } + + /** + * Provides a way to stop processing records from inside a Visit + */ + public void stop() { + go = false; + } public void delete() { csv.delete(); |