Die Migration der Bereiche "Docker Registry" und "Artifiacts" ist fast abgeschlossen. Die letzten Daten werden im Laufe des heutigen Abend (05.08.2021) noch vollständig hochgeladen. Das Anlegen neuer Images und Artifacts funktioniert bereits wieder.

Commit 62a8b84c authored by Jean-Marc Ronck's avatar Jean-Marc Ronck
Browse files

Fixes new routine for Linux (4).

parent e11a56eb
Pipeline #73330 failed with stage
in 29 seconds
......@@ -36,7 +36,17 @@ public class ResourcesServiceImpl implements ResourcesService, ApplicationContri
@Override
public void addResource(String id, String resource) {
if (this.resources.containsKey(id)) this.logger.warning("A resource under the id of " + id + " was already registered");
else this.resources.put(id, resource);
else this.resources.put(id, this.relativize(resource, 7)); //Linux
}
protected String relativize(String resource, int depth) {
StringBuilder relativePart = new StringBuilder();
for (int i = 0; i < depth; i++) {
relativePart.append("../");
}
return relativePart.toString() + resource;
}
@Override
......@@ -48,7 +58,6 @@ public class ResourcesServiceImpl implements ResourcesService, ApplicationContri
public InputStream getResourceAsStream(String id) {
String resource = this.resources.get(id);
this.logger.info(ResourcesServiceImpl.class.getClassLoader().getResource(resource).toString());
return ResourcesServiceImpl.class.getClassLoader().getResourceAsStream(resource);
return ResourcesServiceImpl.class.getResourceAsStream(resource);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment