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

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

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

revision 1.14 by mkoch, Fri Oct 22 18:02:06 2004 UTC revision 1.15 by mark, Fri Dec 10 13:59:14 2004 UTC
# Line 55  public class ZipEntry implements ZipCons Line 55  public class ZipEntry implements ZipCons
55    private static final int KNOWN_CSIZE  = 2;    private static final int KNOWN_CSIZE  = 2;
56    private static final int KNOWN_CRC    = 4;    private static final int KNOWN_CRC    = 4;
57    private static final int KNOWN_TIME   = 8;    private static final int KNOWN_TIME   = 8;
58      private static final int KNOWN_EXTRA  = 16;
59    
60    private static Calendar cal;    private static Calendar cal;
61    
# Line 186  public class ZipEntry implements ZipCons Line 187  public class ZipEntry implements ZipCons
187    {    {
188      if ((known & KNOWN_TIME) == 0)      if ((known & KNOWN_TIME) == 0)
189        return -1;        return -1;
190        
191        // The extra bytes might contain the time (posix/unix extension)
192        parseExtra ();
193    
194      int sec = 2 * (dostime & 0x1f);      int sec = 2 * (dostime & 0x1f);
195      int min = (dostime >> 5) & 0x3f;      int min = (dostime >> 5) & 0x3f;
196      int hrs = (dostime >> 11) & 0x1f;      int hrs = (dostime >> 11) & 0x1f;
# Line 317  public class ZipEntry implements ZipCons Line 321  public class ZipEntry implements ZipCons
321          this.extra = null;          this.extra = null;
322          return;          return;
323        }        }
   
324      if (extra.length > 0xffff)      if (extra.length > 0xffff)
325        throw new IllegalArgumentException();        throw new IllegalArgumentException();
326      this.extra = extra;      this.extra = extra;
327      }
328    
329      private void parseExtra()
330      {
331        // Already parsed?
332        if ((known & KNOWN_EXTRA) != 0)
333          return;
334    
335        if (extra == null)
336          {
337            known |= KNOWN_EXTRA;
338            return;
339          }
340    
341      try      try
342        {        {
343          int pos = 0;          int pos = 0;
# Line 351  public class ZipEntry implements ZipCons Line 368  public class ZipEntry implements ZipCons
368          /* be lenient */          /* be lenient */
369          return;          return;
370        }        }
371    
372        known |= KNOWN_EXTRA;
373    }    }
374    
375    /**    /**

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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