View | Details | Raw Unified | Return to bug 36560 | Differences between
and this patch

Collapse All | Expand All | Context: (Patch / File /
)

(-)java/util/zip/ZipFile.java (-1 / +5 lines)
Line 1    Link Here 
1
        inp.skip(6);
1
        inp.skip(4);
2
    int generalPurposeFlags = inp.readLeShort();
3
    entry.setGeneralPurposeFlags(generalPurposeFlags);
4
    if (zipEntry.isEncrypted())
5
      throw new ZipException("Entry is encrypted");
(-)java/util/zip/ZipEntry.java (+22 lines)
Line 1    Link Here 
1
  private short generalPurposeFlags;
2
   * Sets in the value of the general purpose flags for the zip entry.
3
   *
4
   * @param generalPurposeFlags the general purpose flags.
5
   */
6
  void setGeneralPurposeFlags(int generalPurposeFlags)
7
  {
8
    this.generalPurposeFlags = (short) generalPurposeFlags;
9
  }
10
11
  /**
12
   * Uses the general purpose flags to determine whether the entry is encrypted.
13
   *
14
   * @return {@code true} if the entry is encrypted, {@code false} otherwise.
15
   */
16
  boolean isEncrypted()
17
  {
18
    // bit 0 means it's encrypted.  bit 6 means strong encryption but in this case bit 0 is still set.
19
    return (generalPurposeFlags & 0x1) != 0;
20
  }
21
22
  /**