| 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 | * https://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 | |
| 21 | import java.security.cert.Certificate; |
| 22 | import java.util.jar.Attributes; |
| 23 | import java.util.jar.JarEntry; |
| 24 | import java.util.zip.ZipEntry; |
| 25 | import java.util.zip.ZipException; |
| 26 | |
| 27 | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; |
| 28 | |
| 29 | /** |
| 30 | * JAR archive entry. |
| 31 | * |
| 32 | * @NotThreadSafe (parent is not thread-safe) |
| 33 | */ |
| 34 | public class JarArchiveEntry extends ZipArchiveEntry { |
| 35 | |
| 36 | /** |
| 37 | * Constructs a new instance. |
| 38 | * |
| 39 | * @param entry See super. |
| 40 | * @throws ZipException See super. |
| 41 | */ |
| 42 | public JarArchiveEntry(final JarEntry entry) throws ZipException { |
| 43 | super(entry); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Constructs a new instance. |
| 48 | * |
| 49 | * @param name See super. |
| 50 | */ |
| 51 | public JarArchiveEntry(final String name) { |
| 52 | super(name); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Constructs a new instance. |
| 57 | * |
| 58 | * @param entry See super. |
| 59 | * @throws ZipException See super. |
| 60 | */ |
| 61 | public JarArchiveEntry(final ZipArchiveEntry entry) throws ZipException { |
| 62 | super(entry); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Constructs a new instance. |
| 67 | * |
| 68 | * @param entry See super. |
| 69 | * @throws ZipException See super. |
| 70 | */ |
| 71 | public JarArchiveEntry(final ZipEntry entry) throws ZipException { |
| 72 | super(entry); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Gets a copy of the list of certificates or null if there are none. |
| 77 | * |
| 78 | * @return Always returns null in the current implementation |
| 79 | * @deprecated since 1.5, not currently implemented |
| 80 | */ |
| 81 | @Deprecated |
| 82 | public Certificate[] getCertificates() { |
| 83 | // |
| 84 | // Note, the method |
| 85 | // Certificate[] java.util.jar.JarEntry.getCertificates() |
| 86 | // also returns null or the list of certificates (but not copied) |
| 87 | // |
| 88 | // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion |
| 89 | return null; |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * This method is not implemented and won't ever be. The JVM equivalent has a different name {@link java.util.jar.JarEntry#getAttributes()} |
| 94 | * |
| 95 | * @deprecated since 1.5, do not use; always returns null |
| 96 | * @return Always returns null. |
| 97 | */ |
| 98 | @Deprecated |
| 99 | public Attributes getManifestAttributes() { |
| 100 | // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion |
| 101 | return null; |
| 102 | } |
| 103 | |
| 104 | } |