Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2010-03-30 14:45:07 -0400
committerThomas Watson2010-03-30 14:45:07 -0400
commit8ea2d08be7cf301194ad39c4dff373799bd01cae (patch)
treed39aae4e75e5e6fddba9a40c45ff06cf4c23ce87
parentb5587315af6febcad7fc067fb7d94a8e36b7a4db (diff)
downloadrt.equinox.framework-8ea2d08be7cf301194ad39c4dff373799bd01cae.tar.gz
rt.equinox.framework-8ea2d08be7cf301194ad39c4dff373799bd01cae.tar.xz
rt.equinox.framework-8ea2d08be7cf301194ad39c4dff373799bd01cae.zip
Bug 307209 - ZipException missing filename
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java30
1 files changed, 19 insertions, 11 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java
index 8376bfc88..6b662afcb 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/util/SecureAction.java
@@ -15,6 +15,7 @@ import java.io.*;
import java.net.*;
import java.security.*;
import java.util.Properties;
+import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.osgi.framework.*;
@@ -245,18 +246,25 @@ public class SecureAction {
* @throws IOException if an error occured
*/
public ZipFile getZipFile(final File file) throws IOException {
- if (System.getSecurityManager() == null)
- return new ZipFile(file);
try {
- return (ZipFile) AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return new ZipFile(file);
- }
- }, controlContext);
- } catch (PrivilegedActionException e) {
- if (e.getException() instanceof IOException)
- throw (IOException) e.getException();
- throw (RuntimeException) e.getException();
+ if (System.getSecurityManager() == null)
+ return new ZipFile(file);
+ try {
+ return (ZipFile) AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws IOException {
+ return new ZipFile(file);
+ }
+ }, controlContext);
+ } catch (PrivilegedActionException e) {
+ if (e.getException() instanceof IOException)
+ throw (IOException) e.getException();
+ throw (RuntimeException) e.getException();
+ }
+ } catch (IOException e) {
+ IOException fileNameEx = new ZipException("Exception in opening zip file: " + file.getPath()); //$NON-NLS-1$
+ fileNameEx.initCause(e);
+ throw fileNameEx;
+
}
}

Back to the top