summaryrefslogtreecommitdiffstats
path: root/cadi/core
diff options
context:
space:
mode:
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==',') {