/[classpath]/classpath/java/util/zip/ZipFile.java
ViewVC logotype

Diff of /classpath/java/util/zip/ZipFile.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16.2.6 by gnu_andrew, Sat Sep 10 15:31:47 2005 UTC revision 1.16.2.7 by gnu_andrew, Tue Sep 20 18:46:30 2005 UTC
# Line 144  public class ZipFile implements ZipConst Line 144  public class ZipFile implements ZipConst
144    private void checkZipFile() throws IOException, ZipException    private void checkZipFile() throws IOException, ZipException
145    {    {
146      byte[] magicBuf = new byte[4];      byte[] magicBuf = new byte[4];
147      raf.read(magicBuf);      boolean validRead = true;
148    
149      if (readLeInt(magicBuf, 0) != LOCSIG)      try
150          {
151            raf.readFully(magicBuf);
152          }
153        catch (EOFException eof)
154          {
155            validRead = false;
156          }
157    
158        if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG)
159        {        {
160          raf.close();          raf.close();
161          throw new ZipException("Not a valid zip file");          throw new ZipException("Not a valid zip file");
# Line 377  public class ZipFile implements ZipConst Line 386  public class ZipFile implements ZipConst
386     * Checks that the ZipFile is still open and reads entries when necessary.     * Checks that the ZipFile is still open and reads entries when necessary.
387     *     *
388     * @exception IllegalStateException when the ZipFile has already been closed.     * @exception IllegalStateException when the ZipFile has already been closed.
389     * @exception IOEexception when the entries could not be read.     * @exception IOException when the entries could not be read.
390     */     */
391    private HashMap getEntries() throws IOException    private HashMap getEntries() throws IOException
392    {    {
# Line 395  public class ZipFile implements ZipConst Line 404  public class ZipFile implements ZipConst
404    /**    /**
405     * Searches for a zip entry in this archive with the given name.     * Searches for a zip entry in this archive with the given name.
406     *     *
407     * @param the name. May contain directory components separated by     * @param name the name. May contain directory components separated by
408     * slashes ('/').     * slashes ('/').
409     * @return the zip entry, or null if no entry with that name exists.     * @return the zip entry, or null if no entry with that name exists.
410     *     *

Legend:
Removed from v.1.16.2.6  
changed lines
  Added in v.1.16.2.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26