Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static ClassLoader getClassLoader(final Class<?> class1, final Class<?> c
LOGGER.trace("Trying to find [{}] using context class loader {}.", resource, classLoader);
final URL url = classLoader.getResource(resource);
if (url != null) {
LOGGER.debug("Found [{}] at {} using context class loader.", resource, url);
return url;
}
}
Expand All @@ -104,6 +105,7 @@ public static ClassLoader getClassLoader(final Class<?> class1, final Class<?> c
LOGGER.trace("Trying to find [{}] using {} class loader.", resource, classLoader);
final URL url = classLoader.getResource(resource);
if (url != null) {
LOGGER.debug("Found [{}] at {} using {} class loader.", resource, url, classLoader);
return url;
}
}
Expand All @@ -112,6 +114,7 @@ public static ClassLoader getClassLoader(final Class<?> class1, final Class<?> c
LOGGER.trace("Trying to find [{}] using {} class loader.", resource, defaultLoader);
final URL url = defaultLoader.getResource(resource);
if (url != null) {
LOGGER.debug("Found [{}] at {} using {} class loader.", resource, url, defaultLoader);
return url;
}
}
Expand All @@ -127,7 +130,11 @@ public static ClassLoader getClassLoader(final Class<?> class1, final Class<?> c
// loader which the parent of the system class loader. Hence the
// code below.
LOGGER.trace("Trying to find [{}] using ClassLoader.getSystemResource().", resource);
return ClassLoader.getSystemResource(resource);
final URL url = ClassLoader.getSystemResource(resource);
if (url != null) {
LOGGER.debug("Found [{}] at {} using system class loader.", resource, url);
}
return url;
}

/**
Expand Down Expand Up @@ -157,6 +164,7 @@ public static InputStream getResourceAsStream(final String resource, final Class
LOGGER.trace("Trying to find [{}] using context class loader {}.", resource, classLoader);
is = classLoader.getResourceAsStream(resource);
if (is != null) {
LOGGER.debug("Found [{}] using context class loader {}.", resource, classLoader);
return is;
}
}
Expand All @@ -167,6 +175,7 @@ public static InputStream getResourceAsStream(final String resource, final Class
LOGGER.trace("Trying to find [{}] using {} class loader.", resource, classLoader);
is = classLoader.getResourceAsStream(resource);
if (is != null) {
LOGGER.debug("Found [{}] using {} class loader.", resource, classLoader);
return is;
}
}
Expand All @@ -176,6 +185,7 @@ public static InputStream getResourceAsStream(final String resource, final Class
LOGGER.trace("Trying to find [{}] using {} class loader.", resource, defaultLoader);
is = defaultLoader.getResourceAsStream(resource);
if (is != null) {
LOGGER.debug("Found [{}] using {} class loader.", resource, defaultLoader);
return is;
}
}
Expand All @@ -191,7 +201,11 @@ public static InputStream getResourceAsStream(final String resource, final Class
// loader which the parent of the system class loader. Hence the
// code below.
LOGGER.trace("Trying to find [{}] using ClassLoader.getSystemResource().", resource);
return ClassLoader.getSystemResourceAsStream(resource);
final InputStream is = ClassLoader.getSystemResourceAsStream(resource);
if (is != null) {
LOGGER.debug("Found [{}] using system class loader.", resource);
}
return is;
}

/**
Expand Down