summaryrefslogtreecommitdiffstats
path: root/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'jurt/com/sun/star/lib/util/NativeLibraryLoader.java')
-rw-r--r--jurt/com/sun/star/lib/util/NativeLibraryLoader.java39
1 files changed, 20 insertions, 19 deletions
diff --git a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
index 099cf69d1881..d9486550855e 100644
--- a/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/jurt/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -89,33 +89,34 @@ public final class NativeLibraryLoader {
// (scheme://auth/dir1/name). The second step is important in a typical
// OOo installation, where the JAR files are in the program/classes
// directory while the shared libraries are in the program directory.
- if (loader instanceof URLClassLoader) {
- URL[] urls = ((URLClassLoader) loader).getURLs();
- for (int i = 0; i < urls.length; ++i) {
- File path = UrlToFileMapper.mapUrlToFile(urls[i]);
- if (path != null) {
- File dir = path.isDirectory() ? path : path.getParentFile();
+ if (!(loader instanceof URLClassLoader)) {
+ return null;
+ }
+ URL[] urls = ((URLClassLoader) loader).getURLs();
+ for (int i = 0; i < urls.length; ++i) {
+ File path = UrlToFileMapper.mapUrlToFile(urls[i]);
+ if (path != null) {
+ File dir = path.isDirectory() ? path : path.getParentFile();
+ if (dir != null) {
+ path = new File(dir, name);
+ if (path.exists()) {
+ return path;
+ }
+ dir = dir.getParentFile();
if (dir != null) {
path = new File(dir, name);
if (path.exists()) {
return path;
}
- dir = dir.getParentFile();
- if (dir != null) {
- path = new File(dir, name);
+ // On OS X, dir is now the Resources dir,
+ // we want to look in Frameworks
+ if (System.getProperty("os.name").startsWith("Mac")
+ && dir.getName().equals("Resources")) {
+ dir = dir.getParentFile();
+ path = new File(dir, "Frameworks/" + name);
if (path.exists()) {
return path;
}
- // On OS X, dir is now the Resources dir,
- // we want to look in Frameworks
- if (System.getProperty("os.name").startsWith("Mac")
- && dir.getName().equals("Resources")) {
- dir = dir.getParentFile();
- path = new File(dir, "Frameworks/" + name);
- if (path.exists()) {
- return path;
- }
- }
}
}
}