summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/os/NativeLibrary.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-06-09 05:33:16 +0200
committerSven Gothel <[email protected]>2013-06-09 05:33:16 +0200
commitb98825eb7cfb61aead4a7dff57471cd2d2c26823 (patch)
tree8190c7eaac697e4150e47424dc975be512a3979d /src/java/com/jogamp/common/os/NativeLibrary.java
parent959d6d83ec26152343d538287c02eeebf0dcf238 (diff)
Fix Bug 683 part1: IOUtil, JarUtil, TempJarCache, .. uses URI instead of URL to remove DNS Lookups etc ..
Diffstat (limited to 'src/java/com/jogamp/common/os/NativeLibrary.java')
-rw-r--r--src/java/com/jogamp/common/os/NativeLibrary.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java
index 130812c..2351391 100644
--- a/src/java/com/jogamp/common/os/NativeLibrary.java
+++ b/src/java/com/jogamp/common/os/NativeLibrary.java
@@ -50,6 +50,7 @@ import jogamp.common.os.WindowsDynamicLinkerImpl;
import java.io.*;
import java.lang.reflect.*;
+import java.net.URISyntaxException;
import java.security.*;
import java.util.*;
@@ -254,7 +255,12 @@ public class NativeLibrary implements DynamicLookupHelper {
* @return basename of libName w/o path, ie. /usr/lib/libDrinkBeer.so -> DrinkBeer on Unix systems, but null on Windows.
*/
public static String isValidNativeLibraryName(String libName, boolean isLowerCaseAlready) {
- final String libBaseName = IOUtil.getBasename(libName);
+ final String libBaseName;
+ try {
+ libBaseName = IOUtil.getBasename(libName);
+ } catch (URISyntaxException uriEx) {
+ throw new IllegalArgumentException(uriEx);
+ }
final String libBaseNameLC = isLowerCaseAlready ? libBaseName : libBaseName.toLowerCase();
int prefixIdx = -1;
for(int i=0; i<prefixes.length && 0 > prefixIdx; i++) {
@@ -405,7 +411,12 @@ public class NativeLibrary implements DynamicLookupHelper {
// If the library name already has the prefix / suffix added
// (principally because we want to force a version number on Unix
// operating systems) then just return the library name.
- final String libBaseNameLC = IOUtil.getBasename(libName).toLowerCase();
+ final String libBaseNameLC;
+ try {
+ libBaseNameLC = IOUtil.getBasename(libName).toLowerCase();
+ } catch (URISyntaxException uriEx) {
+ throw new IllegalArgumentException(uriEx);
+ }
int prefixIdx = -1;
for(int i=0; i<prefixes.length && 0 > prefixIdx; i++) {