KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > deployment > util > NestedJarEntry


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 package org.apache.geronimo.deployment.util;
18
19 import java.io.IOException JavaDoc;
20 import java.security.cert.Certificate JavaDoc;
21 import java.util.jar.Attributes JavaDoc;
22 import java.util.jar.JarEntry JavaDoc;
23 import java.util.jar.Manifest JavaDoc;
24
25 /**
26  * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
27  */

28 public class NestedJarEntry extends JarEntry JavaDoc {
29     private final JarEntry JavaDoc baseEntry;
30     private final Manifest JavaDoc manifest;
31
32     public NestedJarEntry(String JavaDoc name, JarEntry JavaDoc baseEntry, Manifest JavaDoc manifest) {
33         super(name);
34         this.baseEntry = baseEntry;
35         this.manifest = manifest;
36     }
37
38     public JarEntry JavaDoc getBaseEntry() {
39         return baseEntry;
40     }
41
42     public Attributes JavaDoc getAttributes() throws IOException JavaDoc {
43         if (manifest == null) {
44             return null;
45         }
46         return manifest.getAttributes(getName());
47     }
48
49     /**
50      * Always return null. This could be implementd by verifing the signatures
51      * in the manifest file against the actual file, but we don't need this for
52      * Geronimo.
53      * @return null
54      */

55     public Certificate JavaDoc[] getCertificates() {
56         return null;
57     }
58
59     public long getTime() {
60         return baseEntry.getTime();
61     }
62
63     public void setTime(long time) {
64         baseEntry.setTime(time);
65     }
66
67     public long getSize() {
68         return baseEntry.getSize();
69     }
70
71     public void setSize(long size) {
72         baseEntry.setSize(size);
73     }
74
75     public long getCompressedSize() {
76         return baseEntry.getCompressedSize();
77     }
78
79     public void setCompressedSize(long csize) {
80         baseEntry.setCompressedSize(csize);
81     }
82
83     public long getCrc() {
84         return baseEntry.getCrc();
85     }
86
87     public void setCrc(long crc) {
88         baseEntry.setCrc(crc);
89     }
90
91     public int getMethod() {
92         return baseEntry.getMethod();
93     }
94
95     public void setMethod(int method) {
96         baseEntry.setMethod(method);
97     }
98
99     public byte[] getExtra() {
100         return baseEntry.getExtra();
101     }
102
103     public void setExtra(byte[] extra) {
104         baseEntry.setExtra(extra);
105     }
106
107     public String JavaDoc getComment() {
108         return baseEntry.getComment();
109     }
110
111     public void setComment(String JavaDoc comment) {
112         baseEntry.setComment(comment);
113     }
114
115     public boolean isDirectory() {
116         return baseEntry.isDirectory();
117     }
118
119     public String JavaDoc toString() {
120         return baseEntry.toString();
121     }
122
123     public int hashCode() {
124         return baseEntry.hashCode();
125     }
126
127     public Object JavaDoc clone() {
128         return new NestedJarEntry(getName(), baseEntry, manifest);
129     }
130 }
131
Popular Tags