2 * Licensed to the Apache Software Foundation (ASF) under one or more
\r
3 * contributor license agreements. See the NOTICE file distributed with
\r
4 * this work for additional information regarding copyright ownership.
\r
5 * The ASF licenses this file to You under the Apache License, Version 2.0
\r
6 * (the "License"); you may not use this file except in compliance with
\r
7 * the License. You may obtain a copy of the License at
\r
9 * http://www.apache.org/licenses/LICENSE-2.0
\r
11 * Unless required by applicable law or agreed to in writing, software
\r
12 * distributed under the License is distributed on an "AS IS" BASIS,
\r
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 * See the License for the specific language governing permissions and
\r
15 * limitations under the License.
\r
19 package org.apache.tools.zip;
\r
22 * Info-ZIP Unicode Path Extra Field (0x7075):
\r
24 * <p>Stores the UTF-8 version of the file name field as stored in the
\r
25 * local header and central directory header.</p>
\r
28 * Value Size Description
\r
29 * ----- ---- -----------
\r
30 * (UPath) 0x7075 Short tag for this extra block type ("up")
\r
31 * TSize Short total data size for this block
\r
32 * Version 1 byte version of this extra field, currently 1
\r
33 * NameCRC32 4 bytes File Name Field CRC32 Checksum
\r
34 * UnicodeName Variable UTF-8 version of the entry File Name
\r
37 public class UnicodePathExtraField extends AbstractUnicodeExtraField {
\r
39 public static final ZipShort UPATH_ID = new ZipShort(0x7075);
\r
41 public UnicodePathExtraField () {
\r
45 * Assemble as unicode path extension from the name given as
\r
46 * text as well as the encoded bytes actually written to the archive.
\r
48 * @param text The file name
\r
49 * @param bytes the bytes actually written to the archive
\r
50 * @param off The offset of the encoded filename in <code>bytes</code>.
\r
51 * @param len The length of the encoded filename or comment in
\r
52 * <code>bytes</code>.
\r
54 public UnicodePathExtraField(String text, byte[] bytes, int off, int len) {
\r
55 super(text, bytes, off, len);
\r
59 * Assemble as unicode path extension from the name given as
\r
60 * text as well as the encoded bytes actually written to the archive.
\r
62 * @param name The file name
\r
63 * @param bytes the bytes actually written to the archive
\r
65 public UnicodePathExtraField(String name, byte[] bytes) {
\r
69 public ZipShort getHeaderId() {
\r