private static URL getResource(final String path) {
if (path != null && path.length() != 0) {
try {
File file = new File(path);
if (file.exists() && file.isFile()) {
return file.toURI().toURL();
}
return Thread.currentThread().getContextClassLoader().getResource(path);
} catch (MalformedURLException ex) {
getLog().error("Invalid resource path.", ex);
}