# Source code

    001/*
    002 *  Licensed to the Apache Software Foundation (ASF) under one or more
    003 *  contributor license agreements.  See the NOTICE file distributed with
    004 *  this work for additional information regarding copyright ownership.
    005 *  The ASF licenses this file to You under the Apache License, Version 2.0
    006 *  (the "License"); you may not use this file except in compliance with
    007 *  the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 *  Unless required by applicable law or agreed to in writing, software
    012 *  distributed under the License is distributed on an "AS IS" BASIS,
    013 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 *  See the License for the specific language governing permissions and
    015 *  limitations under the License.
    016 *
    017 */
    018
    019package org.apache.commons.compress.archivers.zip;
    020
    021/**
    022 * Info-ZIP Unicode Path Extra Field (0x7075):
    023 *
    024 * <p>Stores the UTF-8 version of the file name field as stored in the
    025 * local header and central directory header.</p>
    026 *
    027 * @see <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">PKWARE
    028 * APPNOTE.TXT, section 4.6.9</a>
    029 *
    030 * @NotThreadSafe super-class is not thread-safe
    031 */
    032public class UnicodePathExtraField extends AbstractUnicodeExtraField {
    033
    034    public static final ZipShort UPATH_ID = new ZipShort(0x7075);
    035
    036    public UnicodePathExtraField () {
    037    }
    038
    039    /**
    040     * Assemble as unicode path extension from the name given as
    041     * text as well as the encoded bytes actually written to the archive.
    042     *
    043     * @param text The file name
    044     * @param bytes the bytes actually written to the archive
    045     * @param off The offset of the encoded filename in <code>bytes</code>.
    046     * @param len The length of the encoded filename or comment in
    047     * <code>bytes</code>.
    048     */
    049    public UnicodePathExtraField(final String text, final byte[] bytes, final int off, final int len) {
    050        super(text, bytes, off, len);
    051    }
    052
    053    /**
    054     * Assemble as unicode path extension from the name given as
    055     * text as well as the encoded bytes actually written to the archive.
    056     *
    057     * @param name The file name
    058     * @param bytes the bytes actually written to the archive
    059     */
    060    public UnicodePathExtraField(final String name, final byte[] bytes) {
    061        super(name, bytes);
    062    }
    063
    064    @Override
    065    public ZipShort getHeaderId() {
    066        return UPATH_ID;
    067    }
    068}