diff options
| author | Tom Tromey <tromey@redhat.com> | 2005-02-10 02:43:16 +0000 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2005-02-10 02:43:16 +0000 |
| commit | 4fc2828fcb2a20b2b414aa411847d33da6dd45be (patch) | |
| tree | ed1e156a2a05bab986e391d148f3c5797d0ac7e3 /java/util/zip/ZipFile.java | |
| parent | 60d8c5cddc894fa0b5701856ecf0d095ac85a33c (diff) | |
| download | classpath-4fc2828fcb2a20b2b414aa411847d33da6dd45be.tar.gz | |
* 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.
Diffstat (limited to 'java/util/zip/ZipFile.java')
| -rw-r--r-- | java/util/zip/ZipFile.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/java/util/zip/ZipFile.java b/java/util/zip/ZipFile.java index 18a508717..20ba33fa1 100644 --- a/java/util/zip/ZipFile.java +++ b/java/util/zip/ZipFile.java @@ -122,8 +122,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 * @@ -133,11 +131,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(); checkZipFile(); |
