Home » geronimo-2.2-source-release » org.apache.geronimo.deployment.util » [javadoc | source]

    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;
   20   import java.security.cert.Certificate;
   21   import java.util.jar.Attributes;
   22   import java.util.jar.JarEntry;
   23   import java.util.jar.Manifest;
   24   
   25   /**
   26    * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
   27    */
   28   public class NestedJarEntry extends JarEntry {
   29       private final JarEntry baseEntry;
   30       private final Manifest manifest;
   31   
   32       public NestedJarEntry(String name, JarEntry baseEntry, Manifest manifest) {
   33           super(name);
   34           this.baseEntry = baseEntry;
   35           this.manifest = manifest;
   36       }
   37   
   38       public JarEntry getBaseEntry() {
   39           return baseEntry;
   40       }
   41   
   42       public Attributes getAttributes() throws IOException {
   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[] 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 getComment() {
  108           return baseEntry.getComment();
  109       }
  110   
  111       public void setComment(String comment) {
  112           baseEntry.setComment(comment);
  113       }
  114   
  115       public boolean isDirectory() {
  116           return baseEntry.isDirectory();
  117       }
  118   
  119       public String toString() {
  120           return baseEntry.toString();
  121       }
  122   
  123       public int hashCode() {
  124           return baseEntry.hashCode();
  125       }
  126   
  127       public Object clone() {
  128           return new NestedJarEntry(getName(), baseEntry, manifest);
  129       }
  130   }

Home » geronimo-2.2-source-release » org.apache.geronimo.deployment.util » [javadoc | source]