jdk/src/java.base/share/classes/java/util/zip/ZipConstants64.java
author avstepan
Thu, 06 Aug 2015 19:07:35 +0300
changeset 32037 ab4526f4ac10
parent 25859 3317bb8137f4
permissions -rw-r--r--
8133115: docs: replace <tt> tags (obsolete in html5) for java.util.logging, java.util.prefs, java.util.zip, java.util.jar Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2438
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 19843
diff changeset
     2
 * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
2438
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
     4
 *
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2592
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2438
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2592
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2438
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    10
 *
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    15
 * accompanied this code).
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    16
 *
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2592
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2592
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2592
diff changeset
    23
 * questions.
2438
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    24
 */
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    25
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    26
package java.util.zip;
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    27
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    28
/*
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    29
 * This class defines the constants that are used by the classes
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    30
 * which manipulate Zip64 files.
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    31
 */
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    32
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    33
class ZipConstants64 {
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    34
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    35
    /*
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    36
     * ZIP64 constants
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    37
     */
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    38
    static final long ZIP64_ENDSIG = 0x06064b50L;  // "PK\006\006"
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    39
    static final long ZIP64_LOCSIG = 0x07064b50L;  // "PK\006\007"
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    40
    static final int  ZIP64_ENDHDR = 56;           // ZIP64 end header size
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    41
    static final int  ZIP64_LOCHDR = 20;           // ZIP64 end loc header size
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    42
    static final int  ZIP64_EXTHDR = 24;           // EXT header size
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    43
    static final int  ZIP64_EXTID  = 0x0001;       // Extra field Zip64 header ID
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    44
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    45
    static final int  ZIP64_MAGICCOUNT = 0xFFFF;
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    46
    static final long ZIP64_MAGICVAL = 0xFFFFFFFFL;
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    47
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    48
    /*
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    49
     * Zip64 End of central directory (END) header field offsets
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    50
     */
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    51
    static final int  ZIP64_ENDLEN = 4;       // size of zip64 end of central dir
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    52
    static final int  ZIP64_ENDVEM = 12;      // version made by
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    53
    static final int  ZIP64_ENDVER = 14;      // version needed to extract
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    54
    static final int  ZIP64_ENDNMD = 16;      // number of this disk
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    55
    static final int  ZIP64_ENDDSK = 20;      // disk number of start
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    56
    static final int  ZIP64_ENDTOD = 24;      // total number of entries on this disk
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    57
    static final int  ZIP64_ENDTOT = 32;      // total number of entries
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    58
    static final int  ZIP64_ENDSIZ = 40;      // central directory size in bytes
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    59
    static final int  ZIP64_ENDOFF = 48;      // offset of first CEN header
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    60
    static final int  ZIP64_ENDEXT = 56;      // zip64 extensible data sector
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    61
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    62
    /*
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    63
     * Zip64 End of central directory locator field offsets
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    64
     */
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    65
    static final int  ZIP64_LOCDSK = 4;       // disk number start
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    66
    static final int  ZIP64_LOCOFF = 8;       // offset of zip64 end
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    67
    static final int  ZIP64_LOCTOT = 16;      // total number of disks
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    68
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    69
    /*
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    70
     * Zip64 Extra local (EXT) header field offsets
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    71
     */
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    72
    static final int  ZIP64_EXTCRC = 4;       // uncompressed file crc-32 value
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    73
    static final int  ZIP64_EXTSIZ = 8;       // compressed size, 8-byte
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    74
    static final int  ZIP64_EXTLEN = 16;      // uncompressed size, 8-byte
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
    75
2592
ef26f663a2ba 4244499: ZipEntry() does not convert filenames from Unicode to platform
sherman
parents: 2438
diff changeset
    76
    /*
ef26f663a2ba 4244499: ZipEntry() does not convert filenames from Unicode to platform
sherman
parents: 2438
diff changeset
    77
     * Language encoding flag EFS
ef26f663a2ba 4244499: ZipEntry() does not convert filenames from Unicode to platform
sherman
parents: 2438
diff changeset
    78
     */
ef26f663a2ba 4244499: ZipEntry() does not convert filenames from Unicode to platform
sherman
parents: 2438
diff changeset
    79
    static final int EFS = 0x800;       // If this bit is set the filename and
ef26f663a2ba 4244499: ZipEntry() does not convert filenames from Unicode to platform
sherman
parents: 2438
diff changeset
    80
                                        // comment fields for this file must be
ef26f663a2ba 4244499: ZipEntry() does not convert filenames from Unicode to platform
sherman
parents: 2438
diff changeset
    81
                                        // encoded using UTF-8.
ef26f663a2ba 4244499: ZipEntry() does not convert filenames from Unicode to platform
sherman
parents: 2438
diff changeset
    82
19843
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    83
    /*
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    84
     * Constants below are defined here (instead of in ZipConstants)
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    85
     * to avoid being exposed as public fields of ZipFile, ZipEntry,
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    86
     * ZipInputStream and ZipOutputstream.
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    87
     */
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    88
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    89
    /*
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    90
     * Extra field header ID
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    91
     */
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    92
    static final int  EXTID_ZIP64 = 0x0001;    // Zip64
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    93
    static final int  EXTID_NTFS  = 0x000a;    // NTFS
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    94
    static final int  EXTID_UNIX  = 0x000d;    // UNIX
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    95
    static final int  EXTID_EXTT  = 0x5455;    // Info-ZIP Extended Timestamp
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    96
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    97
    /*
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    98
     * EXTT timestamp flags
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
    99
     */
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
   100
    static final int  EXTT_FLAG_LMT = 0x1;       // LastModifiedTime
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
   101
    static final int  EXTT_FLAG_LAT = 0x2;       // LastAccessTime
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
   102
    static final int  EXTT_FLAT_CT  = 0x4;       // CreationTime
71c34227ccb1 8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
sherman
parents: 5506
diff changeset
   103
2438
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
   104
    private ZipConstants64() {}
21c111b51aa8 4681995: Add support for large (> 4GB) zip/jar files
sherman
parents:
diff changeset
   105
}