Fixed resource loading to check thread classloader first
This commit is contained in:
parent
eabcaeaa52
commit
e18fb6a1cc
|
@ -159,11 +159,16 @@ public abstract class SystemTray {
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe it's in somewhere else.
|
// maybe it's in somewhere else.
|
||||||
URL systemResource = ClassLoader.getSystemResource(fileName);
|
URL systemResource = Thread.currentThread().getContextClassLoader().getResource(fileName);
|
||||||
|
if (systemResource == null) {
|
||||||
|
// maybe it's in the system classloader?
|
||||||
|
systemResource = ClassLoader.getSystemResource(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
if (systemResource != null) {
|
if (systemResource != null) {
|
||||||
// copy out to a temp file, as a hash of the file
|
// copy out to a temp file, as a hash of the file
|
||||||
String file = systemResource.getFile();
|
String resourceFileName = systemResource.getPath();
|
||||||
byte[] bytes = file.getBytes(UTF_8);
|
byte[] bytes = resourceFileName.getBytes(UTF_8);
|
||||||
File newFile;
|
File newFile;
|
||||||
String tempDir = System.getProperty("java.io.tmpdir");
|
String tempDir = System.getProperty("java.io.tmpdir");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user