summaryrefslogtreecommitdiffstats
path: root/cadi/core
diff options
context:
space:
mode:
authorSai Gandham <sai.gandham@att.com>2019-03-13 23:40:45 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-13 23:40:45 +0000
commitda6154df2951bbdedea753f588d41153e3582ef5 (patch)
treec1775704aef15ca129bdd9b36a35ca696a38adf3 /cadi/core
parentcf3cdabcaeb2a4854618ff31fdf24e6793277c9a (diff)
parent889a9891f6df5bbb26a760cfb106be947e87aa5c (diff)
Merge "Batch Test improvements"
Diffstat (limited to 'cadi/core')
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java9
-rw-r--r--cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java23
2 files changed, 23 insertions, 9 deletions
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java
index cd8eff44..01bf6f2e 100644
--- a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java
+++ b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java
@@ -303,7 +303,14 @@ public class CadiFilter implements Filter {
private boolean noAuthn(HttpServletRequest hreq) {
if (pathExceptions!=null) {
String pi = hreq.getPathInfo();
- if (pi==null) return false; // JBoss sometimes leaves null
+ if (pi==null) {
+ // Attempt to get from URI only (Daniel Rose)
+ pi = hreq.getRequestURI().substring(hreq.getContextPath().length());
+ if(pi==null) {
+ // Nothing works.
+ return false; // JBoss sometimes leaves null
+ }
+ }
for (String pe : pathExceptions) {
if (pi.startsWith(pe))return true;
}
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 1d60ae58..47de84ed 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
@@ -44,6 +44,7 @@ public class CSV {
private File csv;
private Access access;
private boolean processAll;
+ private char delimiter = ',';
public CSV(Access access, File file) {
this.access = access;
@@ -57,6 +58,11 @@ public class CSV {
processAll = false;
}
+ public CSV setDelimiter(char delimiter) {
+ this.delimiter = delimiter;
+ return this;
+ }
+
public String name() {
return csv.getName();
}
@@ -116,16 +122,17 @@ public class CSV {
escape = true;
}
break;
- case ',':
- if(quotes) {
- sb.append(c);
+ default:
+ if(delimiter==c) {
+ if(quotes) {
+ sb.append(c);
+ } else {
+ row.add(sb.toString());
+ sb.setLength(0);
+ }
} else {
- row.add(sb.toString());
- sb.setLength(0);
+ sb.append(c);
}
- break;
- default:
- sb.append(c);
}
}
if(sb.length()>0 || c==',') {