JarArchiveEntry.java

  1. /*
  2.  * Licensed to the Apache Software Foundation (ASF) under one
  3.  * or more contributor license agreements.  See the NOTICE file
  4.  * distributed with this work for additional information
  5.  * regarding copyright ownership.  The ASF licenses this file
  6.  * to you under the Apache License, Version 2.0 (the
  7.  * "License"); you may not use this file except in compliance
  8.  * with the License.  You may obtain a copy of the License at
  9.  *
  10.  * http://www.apache.org/licenses/LICENSE-2.0
  11.  *
  12.  * Unless required by applicable law or agreed to in writing,
  13.  * software distributed under the License is distributed on an
  14.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15.  * KIND, either express or implied.  See the License for the
  16.  * specific language governing permissions and limitations
  17.  * under the License.
  18.  */
  19. package org.apache.commons.compress.archivers.jar;

  20. import java.security.cert.Certificate;
  21. import java.util.jar.Attributes;
  22. import java.util.jar.JarEntry;
  23. import java.util.zip.ZipEntry;
  24. import java.util.zip.ZipException;

  25. import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;

  26. /**
  27.  * JAR archive entry.
  28.  *
  29.  * @NotThreadSafe (parent is not thread-safe)
  30.  */
  31. public class JarArchiveEntry extends ZipArchiveEntry {

  32.     /**
  33.      * Constructs a new instance.
  34.      *
  35.      * @param entry See super.
  36.      * @throws ZipException See super.
  37.      */
  38.     public JarArchiveEntry(final JarEntry entry) throws ZipException {
  39.         super(entry);
  40.     }

  41.     /**
  42.      * Constructs a new instance.
  43.      *
  44.      * @param name See super.
  45.      */
  46.     public JarArchiveEntry(final String name) {
  47.         super(name);
  48.     }

  49.     /**
  50.      * Constructs a new instance.
  51.      *
  52.      * @param entry See super.
  53.      * @throws ZipException See super.
  54.      */
  55.     public JarArchiveEntry(final ZipArchiveEntry entry) throws ZipException {
  56.         super(entry);
  57.     }

  58.     /**
  59.      * Constructs a new instance.
  60.      *
  61.      * @param entry See super.
  62.      * @throws ZipException See super.
  63.      */
  64.     public JarArchiveEntry(final ZipEntry entry) throws ZipException {
  65.         super(entry);
  66.     }

  67.     /**
  68.      * Gets a copy of the list of certificates or null if there are none.
  69.      *
  70.      * @return Always returns null in the current implementation
  71.      * @deprecated since 1.5, not currently implemented
  72.      */
  73.     @Deprecated
  74.     public Certificate[] getCertificates() {
  75.         //
  76.         // Note, the method
  77.         // Certificate[] java.util.jar.JarEntry.getCertificates()
  78.         // also returns null or the list of certificates (but not copied)
  79.         //
  80.         // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion
  81.         return null;
  82.     }

  83.     /**
  84.      * This method is not implemented and won't ever be. The JVM equivalent has a different name {@link java.util.jar.JarEntry#getAttributes()}
  85.      *
  86.      * @deprecated since 1.5, do not use; always returns null
  87.      * @return Always returns null.
  88.      */
  89.     @Deprecated
  90.     public Attributes getManifestAttributes() {
  91.         // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion
  92.         return null;
  93.     }

  94. }