public static URI addTrailingSlash()

in src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleRequestMojo.java [203:221]


    public static URI addTrailingSlash(URI targetURL) {
        if (!targetURL.getPath().endsWith("/")) {
            String path = targetURL.getPath() + "/";
            try {
                return new URI(
                        targetURL.getScheme(),
                        targetURL.getUserInfo(),
                        targetURL.getHost(),
                        targetURL.getPort(),
                        path,
                        targetURL.getQuery(),
                        targetURL.getFragment());
            } catch (URISyntaxException e) {
                throw new IllegalStateException("Could not create new URI from existing one", e); // should never happen
            }
        } else {
            return targetURL;
        }
    }