Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public FMod_UI() {}
private static ArgDecl argUIFiles = new ArgDecl(true, "ui");

/** Java resource name used to find the UI files. */
private static String resourceNameUI = "webapp";
private static String resourceNameUI = "/webapp/index.html";
private static String resourceBaseNameUI = "/webapp";
/** Directory name of the root of UI files */
private static String directoryNameUI = "webapp";

Expand Down Expand Up @@ -153,7 +154,7 @@ private String findFusekiApp(FusekiServerCtl serverCtl) {

// 3:: From a jar.
// Format jar:file:///.../jena-fuseki-ui-VERSION.jar!/webapp/"
String r = fromClasspath(resourceNameUI);
String r = fromClasspath(resourceNameUI, resourceBaseNameUI);
if ( r != null ) {
// Simplify name.
String displayName = loggingName(r);
Expand All @@ -165,16 +166,22 @@ private String findFusekiApp(FusekiServerCtl serverCtl) {
}

// Look for "$resourceName" on the classpath.
private static String fromClasspath(String resourceName) {
private static String fromClasspath(String lookupName, String rootName) {
// Jetty 12.0.15 => warning "Leaked mount"
// Logger : "org.eclipse.jetty.util.resource.ResourceFactory"
//ResourceFactory resourceFactory = ResourceFactory.root();

ResourceFactory resourceFactory = ResourceFactory.closeable();
Resource resource = resourceFactory.newClassLoaderResource(resourceName);
if ( resource != null )
return resource.getURI().toString();
return null;
// Jetty 12.1.9: Need to lookup the name of a resource (lookup name), not the directory (rootName)
try ( ResourceFactory.Closeable resourceFactory = ResourceFactory.closeable() ) {
Resource resource = resourceFactory.newClassLoaderResource(lookupName);
if ( resource == null )
return null;
String x = resource.getURI().toString();
int i = x.indexOf(rootName);
// Up to the rootName
x = x.substring(0, i + rootName.length());
return x;
}
}

// Look for "$path/$resourceName"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<ver.jakarta.json>2.0.1</ver.jakarta.json>

<!-- These two must be in-step -->
<ver.jetty>12.1.8</ver.jetty>
<ver.jetty>12.1.9</ver.jetty>
<ver.jakarta-servlet>6.1.0</ver.jakarta-servlet>

<!--
Expand Down