Move path computation away from protocol handling

This commit is contained in:
René Pfeuffer
2018-09-12 11:47:53 +02:00
parent ef28350ce3
commit f5d5d3a6dc
2 changed files with 5 additions and 1 deletions

View File

@@ -4,4 +4,8 @@ import java.net.URI;
public interface ScmPathInfo {
URI getApiRestUri();
default URI getRootUri() {
return getApiRestUri().resolve("../..");
}
}

View File

@@ -53,7 +53,7 @@ public abstract class InitializingHttpScmProtocolWrapper {
try {
ScmPathInfoStore scmPathInfoStore = uriInfoStore.get();
if (scmPathInfoStore != null && scmPathInfoStore.get() != null) {
return of(scmPathInfoStore.get().getApiRestUri().resolve("../..").toASCIIString());
return of(scmPathInfoStore.get().getRootUri().toASCIIString());
}
} catch (Exception e) {
logger.debug("could not get ScmPathInfoStore from context", e);