Skip to content

Commit

Permalink
[KOGITO-9584] Michaels comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Jul 19, 2023
1 parent bfcfefc commit 28b3577
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static class Builder {
private URIContentLoader fallback;
private Workflow workflow;
private String authRef;
private URI baseURI;
private String baseURI;

private Builder(URI uri) {
this.uri = uri;
Expand All @@ -95,10 +95,7 @@ public Builder withAuthRef(String authRef) {
}

public Builder withBaseURI(String baseURI) {
if (baseURI != null) {
int lastIndexOf = baseURI.lastIndexOf('/');
this.baseURI = URI.create(lastIndexOf != -1 ? baseURI.substring(0, lastIndexOf) : baseURI);
}
this.baseURI = baseURI;
return this;
}

Expand All @@ -122,8 +119,8 @@ public URIContentLoader build() {
}
}

private static URI compoundURI(URI baseURI, URI uri) {
return URI.create(baseURI.toString() + "/" + uri.toString());
private static URI compoundURI(String baseURI, URI uri) {
return URI.create(baseURI + "/" + uri.toString());
}

private URIContentLoaderFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public static Map<String, Schema> get() {
}

public static void baseURI(String baseURI) {
threadInfo.get().baseURI = baseURI;
if (baseURI != null) {
int lastIndexOf = baseURI.lastIndexOf('/');
threadInfo.get().baseURI = lastIndexOf != -1 ? baseURI.substring(0, lastIndexOf) : baseURI;
}
}

public static String getBaseURI() {
Expand Down

0 comments on commit 28b3577

Please sign in to comment.