Stefan Bodewig | 4e2380b | 2009-02-18 14:51:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | * contributor license agreements. See the NOTICE file distributed with |
| 4 | * this work for additional information regarding copyright ownership. |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | * (the "License"); you may not use this file except in compliance with |
| 7 | * the License. You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | package org.apache.commons.compress.archivers.zip; |
| 20 | |
| 21 | /** |
| 22 | * Info-ZIP Unicode Path Extra Field (0x7075): |
| 23 | * |
| 24 | * <p>Stores the UTF-8 version of the file name field as stored in the |
| 25 | * local header and central directory header.</p> |
| 26 | * |
Stefan Bodewig | 45e51c2 | 2013-12-22 07:03:43 +0000 | [diff] [blame^] | 27 | * @see <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">PKWARE's |
| 28 | * APPNOTE.TXT, section 4.6.9</a> |
| 29 | * |
Sebastian Bazley | 99870ef | 2009-03-28 00:04:36 +0000 | [diff] [blame] | 30 | * @NotThreadSafe super-class is not thread-safe |
Stefan Bodewig | 4e2380b | 2009-02-18 14:51:10 +0000 | [diff] [blame] | 31 | */ |
| 32 | public class UnicodePathExtraField extends AbstractUnicodeExtraField { |
| 33 | |
| 34 | public static final ZipShort UPATH_ID = new ZipShort(0x7075); |
| 35 | |
| 36 | public UnicodePathExtraField () { |
| 37 | } |
| 38 | |
| 39 | /** |
Stefan Bodewig | 853176f | 2009-03-02 16:09:20 +0000 | [diff] [blame] | 40 | * Assemble as unicode path extension from the name given as |
| 41 | * text as well as the encoded bytes actually written to the archive. |
Stefan Bodewig | 4e2380b | 2009-02-18 14:51:10 +0000 | [diff] [blame] | 42 | * |
Sebastian Bazley | 8ebac24 | 2009-03-04 00:18:09 +0000 | [diff] [blame] | 43 | * @param text The file name |
Stefan Bodewig | 853176f | 2009-03-02 16:09:20 +0000 | [diff] [blame] | 44 | * @param bytes the bytes actually written to the archive |
| 45 | * @param off The offset of the encoded filename in <code>bytes</code>. |
| 46 | * @param len The length of the encoded filename or comment in |
| 47 | * <code>bytes</code>. |
Stefan Bodewig | 4e2380b | 2009-02-18 14:51:10 +0000 | [diff] [blame] | 48 | */ |
Stefan Bodewig | 853176f | 2009-03-02 16:09:20 +0000 | [diff] [blame] | 49 | public UnicodePathExtraField(String text, byte[] bytes, int off, int len) { |
| 50 | super(text, bytes, off, len); |
Stefan Bodewig | 4e2380b | 2009-02-18 14:51:10 +0000 | [diff] [blame] | 51 | } |
| 52 | |
Stefan Bodewig | ccc77aa | 2009-02-26 09:07:23 +0000 | [diff] [blame] | 53 | /** |
| 54 | * Assemble as unicode path extension from the name given as |
Stefan Bodewig | 853176f | 2009-03-02 16:09:20 +0000 | [diff] [blame] | 55 | * text as well as the encoded bytes actually written to the archive. |
Stefan Bodewig | ccc77aa | 2009-02-26 09:07:23 +0000 | [diff] [blame] | 56 | * |
| 57 | * @param name The file name |
| 58 | * @param bytes the bytes actually written to the archive |
| 59 | */ |
| 60 | public UnicodePathExtraField(String name, byte[] bytes) { |
| 61 | super(name, bytes); |
| 62 | } |
| 63 | |
Stefan Bodewig | 4e2380b | 2009-02-18 14:51:10 +0000 | [diff] [blame] | 64 | public ZipShort getHeaderId() { |
| 65 | return UPATH_ID; |
| 66 | } |
| 67 | } |