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 Path Extra Field (0x7075): 022 * 023 * <p>Stores the UTF-8 version of the file name field as stored in the 024 * local header and central directory header.</p> 025 * 026 * @see <a href="https://www.pkware.com/documents/casestudies/APPNOTE.TXT">PKWARE 027 * APPNOTE.TXT, section 4.6.9</a> 028 * 029 * @NotThreadSafe super-class is not thread-safe 030 */ 031public class UnicodePathExtraField extends AbstractUnicodeExtraField { 032 033 public static final ZipShort UPATH_ID = new ZipShort(0x7075); 034 035 public UnicodePathExtraField () { 036 } 037 038 /** 039 * Assemble as unicode path extension from the name given as 040 * text as well as the encoded bytes actually written to the archive. 041 * 042 * @param name The file name 043 * @param bytes the bytes actually written to the archive 044 */ 045 public UnicodePathExtraField(final String name, final byte[] bytes) { 046 super(name, bytes); 047 } 048 049 /** 050 * Assemble as unicode path 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 file name in {@code bytes}. 056 * @param len The length of the encoded file name or comment in 057 * {@code bytes}. 058 */ 059 public UnicodePathExtraField(final String text, final byte[] bytes, final int off, final int len) { 060 super(text, bytes, off, len); 061 } 062 063 @Override 064 public ZipShort getHeaderId() { 065 return UPATH_ID; 066 } 067}