diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 02:43:45 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 02:43:45 +0000 |
| commit | 1c2315138ee881376f46af747d2c294894a0918d (patch) | |
| tree | 93906f6d79af424dcd5985d87888c03ab908b55b /libjava | |
| parent | e95849a9a1c89ae1f154dd1e953f8379d9513c08 (diff) | |
| download | ppe42-gcc-1c2315138ee881376f46af747d2c294894a0918d.tar.gz ppe42-gcc-1c2315138ee881376f46af747d2c294894a0918d.zip | |
* gnu/java/net/protocol/jar/Connection.java (getJarFile): Open
jar file with OPEN_DELETE.
* java/util/zip/ZipFile.java (ZipFile): Call deleteOnExit when
OPEN_DELETE is used.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94793 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
| -rw-r--r-- | libjava/ChangeLog | 7 | ||||
| -rw-r--r-- | libjava/gnu/java/net/protocol/jar/Connection.java | 7 | ||||
| -rw-r--r-- | libjava/java/util/zip/ZipFile.java | 11 |
3 files changed, 14 insertions, 11 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index bfb9c002cbf..4053eb76e8b 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,12 @@ 2005-02-09 Tom Tromey <tromey@redhat.com> + * gnu/java/net/protocol/jar/Connection.java (getJarFile): Open + jar file with OPEN_DELETE. + * java/util/zip/ZipFile.java (ZipFile): Call deleteOnExit when + OPEN_DELETE is used. + +2005-02-09 Tom Tromey <tromey@redhat.com> + * java/util/zip/InflaterInputStream.java (markSupported): Override. (mark, reset): Likewise. diff --git a/libjava/gnu/java/net/protocol/jar/Connection.java b/libjava/gnu/java/net/protocol/jar/Connection.java index 9ba2e3fd1ff..1d27e4436ae 100644 --- a/libjava/gnu/java/net/protocol/jar/Connection.java +++ b/libjava/gnu/java/net/protocol/jar/Connection.java @@ -1,5 +1,5 @@ /* Connection - jar url connection for java.net - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -222,9 +222,8 @@ public final class Connection extends JarURLConnection fos.write(buf, 0, len); fos.close(); // Always verify the Manifest, open read only and delete when done. - // XXX ZipFile.OPEN_DELETE not yet implemented. - // jf = new JarFile(f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); - jar_file = new JarFile (f, true, ZipFile.OPEN_READ); + jar_file = new JarFile (f, true, + ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); } return jar_file; diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java index 38ec9e6b565..b2dbe705bbf 100644 --- a/libjava/java/util/zip/ZipFile.java +++ b/libjava/java/util/zip/ZipFile.java @@ -1,5 +1,5 @@ /* ZipFile.java -- - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -117,8 +117,6 @@ public class ZipFile implements ZipConstants * * The contents of the zip file will be accessible until it is closed. * - * The OPEN_DELETE mode is currently unimplemented in this library - * * @since JDK1.3 * @param mode Must be one of OPEN_READ or OPEN_READ | OPEN_DELETE * @@ -128,11 +126,10 @@ public class ZipFile implements ZipConstants */ public ZipFile(File file, int mode) throws ZipException, IOException { + if (mode != OPEN_READ && mode != (OPEN_READ | OPEN_DELETE)) + throw new IllegalArgumentException("invalid mode"); if ((mode & OPEN_DELETE) != 0) - { - throw new IllegalArgumentException - ("OPEN_DELETE mode not supported yet in java.util.zip.ZipFile"); - } + file.deleteOnExit(); this.raf = new RandomAccessFile(file, "r"); this.name = file.getPath(); } |

