OSDN Git Service

dmg作成バージョンの取得方法の修正
[charactermanaj/CharacterManaJ.git] / src / main / java / org / apache / tools / zip / ZipExtraField.java
1 /*\r
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
8  *\r
9  *      http://www.apache.org/licenses/LICENSE-2.0\r
10  *\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
16  *\r
17  */\r
18 \r
19 package org.apache.tools.zip;\r
20 \r
21 import java.util.zip.ZipException;\r
22 \r
23 /**\r
24  * General format of extra field data.\r
25  *\r
26  * <p>Extra fields usually appear twice per file, once in the local\r
27  * file data and once in the central directory.  Usually they are the\r
28  * same, but they don't have to be.  {@link\r
29  * java.util.zip.ZipOutputStream java.util.zip.ZipOutputStream} will\r
30  * only use the local file data in both places.</p>\r
31  *\r
32  */\r
33 public interface ZipExtraField {\r
34 \r
35     /**\r
36      * The Header-ID.\r
37      * @return the header id\r
38      * @since 1.1\r
39      */\r
40     ZipShort getHeaderId();\r
41 \r
42     /**\r
43      * Length of the extra field in the local file data - without\r
44      * Header-ID or length specifier.\r
45      * @return the length of the field in the local file data\r
46      * @since 1.1\r
47      */\r
48     ZipShort getLocalFileDataLength();\r
49 \r
50     /**\r
51      * Length of the extra field in the central directory - without\r
52      * Header-ID or length specifier.\r
53      * @return the length of the field in the central directory\r
54      * @since 1.1\r
55      */\r
56     ZipShort getCentralDirectoryLength();\r
57 \r
58     /**\r
59      * The actual data to put into local file data - without Header-ID\r
60      * or length specifier.\r
61      * @return the data\r
62      * @since 1.1\r
63      */\r
64     byte[] getLocalFileDataData();\r
65 \r
66     /**\r
67      * The actual data to put into central directory - without Header-ID or\r
68      * length specifier.\r
69      * @return the data\r
70      * @since 1.1\r
71      */\r
72     byte[] getCentralDirectoryData();\r
73 \r
74     /**\r
75      * Populate data from this array as if it was in local file data.\r
76      * @param data an array of bytes\r
77      * @param offset the start offset\r
78      * @param length the number of bytes in the array from offset\r
79      *\r
80      * @since 1.1\r
81      * @throws ZipException on error\r
82      */\r
83     void parseFromLocalFileData(byte[] data, int offset, int length)\r
84         throws ZipException;\r
85 }\r