Skip to content

Commit

Permalink
Loading keystore resource if location starts with / (eclipse-ee4j#4258)
Browse files Browse the repository at this point in the history
Loading keystore resource if location starts with /

Signed-off-by: David Kral <david.k.kral@oracle.com>
  • Loading branch information
Verdent authored and pa314159 committed Sep 22, 2019
1 parent cc8686c commit 4fb2ccc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,14 @@ private InputStream locationToStream(String location) throws IOException {

if (location.startsWith(CLASSPATH_LOCATION)) {
String resource = location.substring(CLASSPATH_LOCATION.length());
// first try to read from teh same classloader as the rest client interface
// first try to read from the same classloader as the rest client interface
InputStream result = interfaceType.getResourceAsStream(resource);
if (null == result) {
// and if not found, use the context classloader (for example in TCK, this is needed)
result = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
if (result == null && resource.startsWith("/")) {
result = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource.substring(1));
}
}
return result;
} else if (location.startsWith(FILE_LOCATION)) {
Expand Down

0 comments on commit 4fb2ccc

Please sign in to comment.