This class extends the concept of a codebase to
encapsulate not only the location (URL) but also the certificate(s)
that were used to verify signed code originating from that
location.
Tests for equality between the specified object and this
object. Two CodeSource objects are considered equal if their
locations are of identical value and if the two sets of
certificates are of identical values. It is not required that
the certificates be in the same order.
Returns true if this CodeSource object "implies" the specified CodeSource.
More specifically, this method makes the following checks, in order.
If any fail, it returns false. If they all succeed, it returns true.
codesource must not be null.
If this object's certificates are not null, then all
of this object's certificates must be present in codesource's
certificates.
If this object's location (getLocation()) is not null, then the
following checks are made against this object's location and
codesource's:
codesource's location must not be null.
If this object's location
equals codesource's location, then return true.
This object's protocol (getLocation().getProtocol()) must be
equal to codesource's protocol.
If this object's host (getLocation().getHost()) is not null,
then the SocketPermission
constructed with this object's host must imply the
SocketPermission constructed with codesource's host.
If this object's port (getLocation().getPort()) is not
equal to -1 (that is, if a port is specified), it must equal
codesource's port.
If this object's file (getLocation().getFile()) doesn't equal
codesource's file, then the following checks are made:
If this object's file ends with "/-",
then codesource's file must start with this object's
file (exclusive the trailing "-").
If this object's file ends with a "/*",
then codesource's file must start with this object's
file and must not have any further "/" separators.
If this object's file doesn't end with a "/",
then codesource's file must match this object's
file with a '/' appended.
If this object's reference (getLocation().getRef()) is
not null, it must equal codesource's reference.
For example, the codesource objects with the following locations
and null certificates all imply
the codesource with the location "http://java.sun.com/classes/foo.jar"
and null certificates:
Submit a bug or feature For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, California, 94303, U.S.A. All Rights Reserved.