    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
    018package org.apache.commons.compress.archivers.zip;
    019
    020/**
    021 * Info-ZIP Unicode Comment Extra Field (0x6375):
    022 *
    023 * <p>Stores the UTF-8 version of the file comment as stored in the
    024 * central directory header.</p>
    025 *
    026 * @see <a href="https://www.pkware.com/documents/casestudies/APPNOTE.TXT">PKWARE
    027 * APPNOTE.TXT, section 4.6.8</a>
    028 *
    029 * @NotThreadSafe super-class is not thread-safe
    030 */
    031public class UnicodeCommentExtraField extends AbstractUnicodeExtraField {
    032
    033    public static final ZipShort UCOM_ID = new ZipShort(0x6375);
    034
    035    public UnicodeCommentExtraField () {
    036    }
    037
    038    /**
    039     * Assemble as unicode comment extension from the comment given as
    040     * text as well as the bytes actually written to the archive.
    041     *
    042     * @param comment The file comment
    043     * @param bytes the bytes actually written to the archive
    044     */
    045    public UnicodeCommentExtraField(final String comment, final byte[] bytes) {
    046        super(comment, bytes);
    047    }
    048
    049    /**
    050     * Assemble as unicode comment extension from the name given as
    051     * text as well as the encoded bytes actually written to the archive.
    052     *
    053     * @param text The file name
    054     * @param bytes the bytes actually written to the archive
    055     * @param off The offset of the encoded comment in {@code bytes}.
    056     * @param len The length of the encoded comment or comment in
    057     * {@code bytes}.
    058     */
    059    public UnicodeCommentExtraField(final String text, final byte[] bytes, final int off,
    060                                    final int len) {
    061        super(text, bytes, off, len);
    062    }
    063
    064    @Override
    065    public ZipShort getHeaderId() {
    066        return UCOM_ID;
    067    }
    068
    069}