Skip to content

Commit 7c67bae

Browse files
Verdentsenivam
authored andcommitted
Loading keystore resource if location starts with / (#4258)
Loading keystore resource if location starts with / Signed-off-by: David Kral <david.k.kral@oracle.com>
1 parent fd7a293 commit 7c67bae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/microprofile/mp-rest-client/src/main/java/org/glassfish/jersey/microprofile/restclient/RestClientProducer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,14 @@ private InputStream locationToStream(String location) throws IOException {
329329

330330
if (location.startsWith(CLASSPATH_LOCATION)) {
331331
String resource = location.substring(CLASSPATH_LOCATION.length());
332-
// first try to read from teh same classloader as the rest client interface
332+
// first try to read from the same classloader as the rest client interface
333333
InputStream result = interfaceType.getResourceAsStream(resource);
334334
if (null == result) {
335335
// and if not found, use the context classloader (for example in TCK, this is needed)
336336
result = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
337+
if (result == null && resource.startsWith("/")) {
338+
result = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource.substring(1));
339+
}
337340
}
338341
return result;
339342
} else if (location.startsWith(FILE_LOCATION)) {

0 commit comments

Comments
 (0)