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 */ 019 package org.apache.commons.compress.archivers.jar; 020 021 import java.security.cert.Certificate; 022 import java.util.jar.Attributes; 023 import java.util.jar.JarEntry; 024 import java.util.zip.ZipEntry; 025 import java.util.zip.ZipException; 026 027 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; 028 029 /** 030 * 031 * @NotThreadSafe 032 */ 033 public class JarArchiveEntry extends ZipArchiveEntry { 034 035 private Attributes manifestAttributes = null; 036 private Certificate[] certificates = null; 037 038 public JarArchiveEntry(ZipEntry entry) throws ZipException { 039 super(entry); 040 } 041 042 public JarArchiveEntry(String name) { 043 super(name); 044 } 045 046 public JarArchiveEntry(ZipArchiveEntry entry) throws ZipException { 047 super(entry); 048 } 049 050 public JarArchiveEntry(JarEntry entry) throws ZipException { 051 super(entry); 052 053 } 054 055 public Attributes getManifestAttributes() { 056 return manifestAttributes; 057 } 058 059 public Certificate[] getCertificates() { 060 if (certificates != null) { 061 Certificate[] certs = new Certificate[certificates.length]; 062 System.arraycopy(certificates, 0, certs, 0, certs.length); 063 return certs; 064 } 065 return null; 066 } 067 068 @Override 069 public boolean equals(Object o) { 070 return super.equals(o); 071 } 072 073 @Override 074 public int hashCode() { 075 return super.hashCode(); 076 } 077 }