diff --git a/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/MavenResource.java b/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/MavenResource.java index 42475de50fda..aefe9e1d134a 100644 --- a/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/MavenResource.java +++ b/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/MavenResource.java @@ -217,4 +217,10 @@ public Resource resolve(String subUriPath) return null; return _resource.resolve(subUriPath); } + + @Override + public String toString() + { + return "(Maven) " + _resource.toString(); + } } diff --git a/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/SelectiveJarResource.java b/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/SelectiveJarResource.java index 8e8c44f983e6..22079cc47b1c 100644 --- a/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/SelectiveJarResource.java +++ b/jetty-core/jetty-maven/src/main/java/org/eclipse/jetty/maven/SelectiveJarResource.java @@ -277,4 +277,10 @@ public void copyTo(Path directory) throws IOException } } } + + @Override + public String toString() + { + return "(Selective Jar/Maven) " + _delegate.toString(); + } } diff --git a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index 84ef89a15e36..1a237c236ada 100644 --- a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -715,7 +715,14 @@ protected void doStart() throws Exception if (!Resources.isReadable(baseResource)) throw new IllegalArgumentException("Base Resource is not valid: " + baseResource); if (baseResource.isAlias()) - LOG.warn("Base Resource should not be an alias"); + { + URI realUri = baseResource.getRealURI(); + if (realUri == null) + LOG.warn("Base Resource should not be an alias (100% of requests to context are subject to Security/Alias Checks): {}", baseResource); + else + LOG.warn("Base Resource should not be an alias (100% of requests to context are subject to Security/Alias Checks): {} points to {}", + baseResource, realUri.toASCIIString()); + } } _availability.set(Availability.STARTING); diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/MemoryResource.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/MemoryResource.java index 31970e17cf17..5215218021c8 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/MemoryResource.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/MemoryResource.java @@ -155,6 +155,6 @@ public Collection getAllResources() @Override public String toString() { - return getName(); + return "(Memory) " + _uri.toASCIIString(); } } diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java index d88930e1d6c0..b5fc9657b268 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java @@ -460,4 +460,13 @@ public boolean isSameFile(Path path) } return false; } + + public String toString() + { + String str = getName(); + URI uri = getURI(); + if (uri != null) + str = getURI().toASCIIString(); + return "(" + this.getClass().getSimpleName() + ") " + str; + } } diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResourceFactory.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResourceFactory.java index f186bb23c72e..61db423d822e 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResourceFactory.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResourceFactory.java @@ -308,7 +308,7 @@ public URI getRealURI() @Override public String toString() { - return String.format("URLResource@%X(%s)", this.uri.hashCode(), this.uri.toASCIIString()); + return "(URL) " + this.uri.toASCIIString(); } private static class InputStreamReference extends AtomicReference implements Runnable