in src/main/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContext.java [90:111]
private final String getWorkspace(final String uriPath) {
// Paths to consider | Result
// -------------------+---------
// null | null
// "" (empty) | null
// / | null
// /wsp | wsp
// /wsp/ | wsp
// /wsp/... | wsp
if (uriPath != null && uriPath.length() > 1 && uriPath.charAt(0) == '/') {
int end = uriPath.indexOf('/', 1);
if (end > 1) {
return uriPath.substring(1, end);
} else if (end < 0) {
return uriPath.substring(1);
}
}
return null;
}