    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one
    003 * or more contributor license agreements.  See the NOTICE file
    004 * distributed with this work for additional information
    005 * regarding copyright ownership.  The ASF licenses this file
    006 * to you under the Apache License, Version 2.0 (the
    007 * "License"); you may not use this file except in compliance
    008 * with the License.  You may obtain a copy of the License at
    009 *
    010 * http://www.apache.org/licenses/LICENSE-2.0
    011 *
    012 * Unless required by applicable law or agreed to in writing,
    013 * software distributed under the License is distributed on an
    014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    015 * KIND, either express or implied.  See the License for the
    016 * specific language governing permissions and limitations
    017 * under the License.
    018 */
    019package org.apache.commons.compress.archivers.jar;
    020
    021import java.security.cert.Certificate;
    022import java.util.jar.Attributes;
    023import java.util.jar.JarEntry;
    024import java.util.zip.ZipEntry;
    025import java.util.zip.ZipException;
    026
    027import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
    028
    029/**
    030 * JAR archive entry.
    031 *
    032 * @NotThreadSafe (parent is not thread-safe)
    033 */
    034public class JarArchiveEntry extends ZipArchiveEntry {
    035
    036    /**
    037     * Constructs a new instance.
    038     *
    039     * @param entry See super.
    040     * @throws ZipException See super.
    041     */
    042    public JarArchiveEntry(final JarEntry entry) throws ZipException {
    043        super(entry);
    044    }
    045
    046    /**
    047     * Constructs a new instance.
    048     *
    049     * @param name See super.
    050     */
    051    public JarArchiveEntry(final String name) {
    052        super(name);
    053    }
    054
    055    /**
    056     * Constructs a new instance.
    057     *
    058     * @param entry See super.
    059     * @throws ZipException See super.
    060     */
    061    public JarArchiveEntry(final ZipArchiveEntry entry) throws ZipException {
    062        super(entry);
    063    }
    064
    065    /**
    066     * Constructs a new instance.
    067     *
    068     * @param entry See super.
    069     * @throws ZipException See super.
    070     */
    071    public JarArchiveEntry(final ZipEntry entry) throws ZipException {
    072        super(entry);
    073    }
    074
    075    /**
    076     * Gets a copy of the list of certificates or null if there are none.
    077     *
    078     * @return Always returns null in the current implementation
    079     * @deprecated since 1.5, not currently implemented
    080     */
    081    @Deprecated
    082    public Certificate[] getCertificates() {
    083        //
    084        // Note, the method
    085        // Certificate[] java.util.jar.JarEntry.getCertificates()
    086        // also returns null or the list of certificates (but not copied)
    087        //
    088        // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion
    089        return null;
    090    }
    091
    092    /**
    093     * This method is not implemented and won't ever be. The JVM equivalent has a different name {@link java.util.jar.JarEntry#getAttributes()}
    094     *
    095     * @deprecated since 1.5, do not use; always returns null
    096     * @return Always returns null.
    097     */
    098    @Deprecated
    099    public Attributes getManifestAttributes() {
    100        // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion
    101        return null;
    102    }
    103
    104}