/* JarEntry.java - Represents an entry in a jar file
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
import java.io.IOException;
import java.security.cert.Certificate;
+import java.util.Set;
import java.util.zip.ZipEntry;
/**
// (Package local) fields
Attributes attr;
- Certificate certs[];
+ JarFile jarfile;
// Constructors
{
super(name);
attr = null;
- certs = null;
+ jarfile = null;
}
/**
{
super(entry);
attr = null;
- certs = null;
+ jarfile = null;
}
/**
catch (IOException _)
{
}
- certs = entry.getCertificates();
+ jarfile = entry.jarfile;
}
// Methods
*/
public Certificate[] getCertificates()
{
- if (certs != null)
+ if (jarfile != null)
{
- return (Certificate[])certs.clone();
- }
- else
- {
- return null;
+ synchronized (jarfile)
+ {
+ if (jarfile.entryCerts != null)
+ {
+ Set certs = (Set) jarfile.entryCerts.get(getName());
+ if (certs != null
+ && jarfile.verified.get(getName()) == Boolean.TRUE)
+ return (Certificate[]) certs.toArray(new Certificate[certs.size()]);
+ }
+ }
}
+ return null;
}
}