summaryrefslogtreecommitdiffstats
path: root/cadi/core
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-03-13 17:33:51 -0500
committerInstrumental <jonathan.gathman@att.com>2019-03-13 17:35:55 -0500
commit889a9891f6df5bbb26a760cfb106be947e87aa5c (patch)
tree3d9a9ffedc3782c6061de89c03527911bae3aa33 /cadi/core
parenta50007dcded86acc2dcd610810f8afac720a058a (diff)
Batch Test improvements
Issue-ID: AAF-776 Change-Id: Ia12106331a1db608955abd353785ab2e765b3c41 Signed-off-by: Instrumental <jonathan.gathman@att.com>
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==',') {