changeset 1625:742216fd1f8f

2009-07-07 Omair Majid <omajid@redhat.com> * rt/net/sourceforge/jnlp/resources/Messages.properties: Add RNestedJarExtration. * rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (activateJar): Create parent directories for nested jars.
author Omair Majid <omajid@redhat.com>
date Tue, 07 Jul 2009 10:12:31 -0400
parents 051f9a48387c
children b4bb02c70835
files ChangeLog rt/net/sourceforge/jnlp/resources/Messages.properties rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jul 07 10:58:02 2009 +0200
+++ b/ChangeLog	Tue Jul 07 10:12:31 2009 -0400
@@ -1,3 +1,10 @@
+2009-07-07  Omair Majid  <omajid@redhat.com>
+
+	* rt/net/sourceforge/jnlp/resources/Messages.properties: Add
+	RNestedJarExtration.
+	* rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+	(activateJar): Create parent directories for nested jars.
+
 2009-07-07  Xerxes RĂ„nby  <xerxes@zafena.se>
 
 	* ports/hotspot/src/share/vm/shark/llvmHeaders.hpp
--- a/rt/net/sourceforge/jnlp/resources/Messages.properties	Tue Jul 07 10:58:02 2009 +0200
+++ b/rt/net/sourceforge/jnlp/resources/Messages.properties	Tue Jul 07 10:12:31 2009 -0400
@@ -111,6 +111,7 @@
 RDenyStopped=Stopped applications have no permissions.
 RExitNoApp=Can not exit the JVM because the current application cannot be determined.
 RNoLockDir=Unable to create locks directory ({0})
+RNestedJarExtration=Unable to extract nested jar.
 RUnexpected=Unexpected {0} at {1}
 
 # Boot options, message should be shorter than this ---------------->
--- a/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Tue Jul 07 10:58:02 2009 +0200
+++ b/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Tue Jul 07 10:12:31 2009 -0400
@@ -521,6 +521,10 @@
                                     // with standard classloader methods)
 
                                     String extractedJarLocation = localFile.getParent() + "/" + je.getName();
+                                    File parentDir = new File(extractedJarLocation).getParentFile();
+                                    if (!parentDir.isDirectory() && !parentDir.mkdirs()) {
+                                        throw new RuntimeException(R("RNestedJarExtration"));
+                                    }
                                     FileOutputStream extractedJar = new FileOutputStream(extractedJarLocation);
                                     InputStream is = jarFile.getInputStream(je);