diff options
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r-- | netx/net/sourceforge/jnlp/NullJnlpFileException.java | 22 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/SecurityDesc.java | 14 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 11 |
3 files changed, 41 insertions, 6 deletions
diff --git a/netx/net/sourceforge/jnlp/NullJnlpFileException.java b/netx/net/sourceforge/jnlp/NullJnlpFileException.java new file mode 100644 index 0000000..9c67f61 --- /dev/null +++ b/netx/net/sourceforge/jnlp/NullJnlpFileException.java @@ -0,0 +1,22 @@ +package net.sourceforge.jnlp; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author jvanek + */ +public class NullJnlpFileException extends NullPointerException { + + public NullJnlpFileException() { + super(); + } + + public NullJnlpFileException(String s) { + super(s); + } + +} diff --git a/netx/net/sourceforge/jnlp/SecurityDesc.java b/netx/net/sourceforge/jnlp/SecurityDesc.java index 197fd3d..927917a 100644 --- a/netx/net/sourceforge/jnlp/SecurityDesc.java +++ b/netx/net/sourceforge/jnlp/SecurityDesc.java @@ -233,10 +233,16 @@ public class SecurityDesc { if (grantAwtPermissions) { permissions.add(new AWTPermission("showWindowWithoutWarningBanner")); } - - if (file.isApplication()) - for (int i = 0; i < jnlpRIAPermissions.length; i++) - permissions.add(jnlpRIAPermissions[i]); + if (JNLPRuntime.isWebstartApplication()) { + if (file == null) { + throw new NullJnlpFileException("Can not return sandbox permissions, file is null"); + } + if (file.isApplication()) { + for (int i = 0; i < jnlpRIAPermissions.length; i++) { + permissions.add(jnlpRIAPermissions[i]); + } + } + } if (downloadHost != null && downloadHost.length() > 0) permissions.add(new SocketPermission(downloadHost, diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index 5ec2e70..c30bc48 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -69,6 +69,7 @@ import net.sourceforge.jnlp.JNLPMatcher; import net.sourceforge.jnlp.JNLPMatcherException; import net.sourceforge.jnlp.LaunchDesc; import net.sourceforge.jnlp.LaunchException; +import net.sourceforge.jnlp.NullJnlpFileException; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.ResourcesDesc; @@ -1701,6 +1702,7 @@ public class JNLPClassLoader extends URLClassLoader { /** * Find the class in this loader or any of its extension loaders. */ + @Override protected Class findClass(String name) throws ClassNotFoundException { for (int i = 0; i < loaders.length; i++) { try { @@ -1718,6 +1720,8 @@ public class JNLPClassLoader extends URLClassLoader { } catch (ClassNotFoundException ex) { } catch (ClassFormatError cfe) { } catch (PrivilegedActionException pae) { + } catch (NullJnlpFileException ex) { + throw new ClassNotFoundException(this.mainClass + " in main classloader ", ex); } } @@ -2233,7 +2237,10 @@ public class JNLPClassLoader extends URLClassLoader { }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { notFoundResources.put(name, super.getURLs()); - throw new ClassNotFoundException("Could not find class " + name); + throw new ClassNotFoundException("Could not find class " + name, pae); + } catch (NullJnlpFileException njf) { + notFoundResources.put(name, super.getURLs()); + throw new ClassNotFoundException("Could not find class " + name, njf); } } @@ -2297,7 +2304,7 @@ public class JNLPClassLoader extends URLClassLoader { } }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { - } + } if (url == null) { notFoundResources.put(name, super.getURLs()); |