in src/main/java/org/apache/sling/maven/bundlesupport/deploy/method/IntermediateUrisExtractor.java [47:70]
public static List<URI> extractIntermediateUris(URI uri) {
List<URI> paths = new ArrayList<>();
String path = uri.getPath();
StringBuilder accu = new StringBuilder();
for ( String segment : path.split("/") ) {
// ensure we have a trailing slash to join with the next segment
if ( accu.length() == 0 || accu.charAt(accu.length() - 1) != '/') {
accu.append('/');
}
accu.append(segment);
// don't add the root segment ( / )
if ( segment.length() != 0 ) {
paths.add(0, uri.resolve(accu.toString()));
}
}
return paths;
}