File tree 2 files changed +18
-6
lines changed
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource
2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,7 @@ public class PathResource extends Resource
40
40
{
41
41
private static final Logger LOG = LoggerFactory .getLogger (PathResource .class );
42
42
43
- public static Index <String > SUPPORTED_SCHEMES = new Index .Builder <String >()
44
- .caseSensitive (false )
45
- .with ("file" )
46
- .with ("jrt" )
47
- .build ();
43
+ public static Index <String > SUPPORTED_SCHEMES = initSupportedSchemes (null );
48
44
49
45
// The path object represented by this instance
50
46
private final Path path ;
@@ -541,4 +537,18 @@ public String toString()
541
537
{
542
538
return this .uri .toASCIIString ();
543
539
}
540
+
541
+ static Index <String > initSupportedSchemes (String extraScheme )
542
+ {
543
+ Index .Builder <String > builder = new Index .Builder <String >()
544
+ .caseSensitive (false )
545
+ .with ("file" )
546
+ .with ("jrt" );
547
+ if (extraScheme != null )
548
+ {
549
+ builder = builder .with (extraScheme );
550
+ }
551
+
552
+ return builder .build ();
553
+ }
544
554
}
Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ class ResourceFactoryInternals
76
76
resourceFactory = url .toString ().contains ("!/" ) ? mountedPathResourceFactory : pathResourceFactory ;
77
77
}
78
78
79
- RESOURCE_FACTORIES .put (url .getProtocol (), resourceFactory );
79
+ String protocol = url .getProtocol ();
80
+ PathResource .SUPPORTED_SCHEMES = PathResource .initSupportedSchemes (protocol );
81
+ RESOURCE_FACTORIES .put (protocol , resourceFactory );
80
82
}
81
83
}
82
84
You can’t perform that action at this time.
0 commit comments