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 <[email protected]>
  • Loading branch information
Verdent authored and senivam committed Sep 18, 2019
1 parent fd7a293 commit 7c67bae
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 7c67bae

Please sign in to comment.