Connection.java (getJarFile): Open jar file with OPEN_DELETE.
* 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. From-SVN: r94793
This commit is contained in:
parent
082e25bfb0
commit
cbe24267f9
3 changed files with 14 additions and 11 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
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>
|
2005-02-09 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* java/util/zip/InflaterInputStream.java (markSupported):
|
* java/util/zip/InflaterInputStream.java (markSupported):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Connection - jar url connection for java.net
|
/* 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.
|
This file is part of GNU Classpath.
|
||||||
|
|
||||||
|
@ -222,9 +222,8 @@ public final class Connection extends JarURLConnection
|
||||||
fos.write(buf, 0, len);
|
fos.write(buf, 0, len);
|
||||||
fos.close();
|
fos.close();
|
||||||
// Always verify the Manifest, open read only and delete when done.
|
// Always verify the Manifest, open read only and delete when done.
|
||||||
// XXX ZipFile.OPEN_DELETE not yet implemented.
|
jar_file = new JarFile (f, true,
|
||||||
// jf = new JarFile(f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
|
ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
|
||||||
jar_file = new JarFile (f, true, ZipFile.OPEN_READ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return jar_file;
|
return jar_file;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* ZipFile.java --
|
/* 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.
|
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 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
|
* @since JDK1.3
|
||||||
* @param mode Must be one of OPEN_READ or OPEN_READ | OPEN_DELETE
|
* @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
|
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)
|
if ((mode & OPEN_DELETE) != 0)
|
||||||
{
|
file.deleteOnExit();
|
||||||
throw new IllegalArgumentException
|
|
||||||
("OPEN_DELETE mode not supported yet in java.util.zip.ZipFile");
|
|
||||||
}
|
|
||||||
this.raf = new RandomAccessFile(file, "r");
|
this.raf = new RandomAccessFile(file, "r");
|
||||||
this.name = file.getPath();
|
this.name = file.getPath();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue