< prev index next >

src/java.base/share/classes/java/security/CodeSource.java

Print this page




 292      *     <li>  If this object's file (getLocation().getFile()) doesn't equal
 293      *           <i>codesource</i>'s file, then the following checks are made:
 294      *           If this object's file ends with "/-",
 295      *           then <i>codesource</i>'s file must start with this object's
 296      *           file (exclusive the trailing "-").
 297      *           If this object's file ends with a "/*",
 298      *           then <i>codesource</i>'s file must start with this object's
 299      *           file and must not have any further "/" separators.
 300      *           If this object's file doesn't end with a "/",
 301      *           then <i>codesource</i>'s file must match this object's
 302      *           file with a '/' appended.
 303      *
 304      *     <li>  If this object's reference (getLocation().getRef()) is
 305      *           not null, it must equal <i>codesource</i>'s reference.
 306      *
 307      *   </ul>
 308      * </ul>
 309      * <p>
 310      * For example, the codesource objects with the following locations
 311      * and null certificates all imply
 312      * the codesource with the location "http://java.sun.com/classes/foo.jar"
 313      * and null certificates:
 314      * <pre>
 315      *     http:
 316      *     http://*.sun.com/classes/*
 317      *     http://java.sun.com/classes/-
 318      *     http://java.sun.com/classes/foo.jar
 319      * </pre>
 320      *
 321      * Note that if this CodeSource has a null location and a null
 322      * certificate chain, then it implies every other CodeSource.
 323      *
 324      * @param codesource CodeSource to compare against.
 325      *
 326      * @return true if the specified codesource is implied by this codesource,
 327      * false if not.
 328      */
 329     public boolean implies(CodeSource codesource)
 330     {
 331         if (codesource == null)
 332             return false;
 333 
 334         return matchCerts(codesource, false) && matchLocation(codesource);
 335     }
 336 
 337     /**
 338      * Returns true if all the certs in this




 292      *     <li>  If this object's file (getLocation().getFile()) doesn't equal
 293      *           <i>codesource</i>'s file, then the following checks are made:
 294      *           If this object's file ends with "/-",
 295      *           then <i>codesource</i>'s file must start with this object's
 296      *           file (exclusive the trailing "-").
 297      *           If this object's file ends with a "/*",
 298      *           then <i>codesource</i>'s file must start with this object's
 299      *           file and must not have any further "/" separators.
 300      *           If this object's file doesn't end with a "/",
 301      *           then <i>codesource</i>'s file must match this object's
 302      *           file with a '/' appended.
 303      *
 304      *     <li>  If this object's reference (getLocation().getRef()) is
 305      *           not null, it must equal <i>codesource</i>'s reference.
 306      *
 307      *   </ul>
 308      * </ul>
 309      * <p>
 310      * For example, the codesource objects with the following locations
 311      * and null certificates all imply
 312      * the codesource with the location "http://www.example.com/classes/foo.jar"
 313      * and null certificates:
 314      * <pre>
 315      *     http:
 316      *     http://*.example.com/classes/*
 317      *     http://www.example.com/classes/-
 318      *     http://www.example.com/classes/foo.jar
 319      * </pre>
 320      *
 321      * Note that if this CodeSource has a null location and a null
 322      * certificate chain, then it implies every other CodeSource.
 323      *
 324      * @param codesource CodeSource to compare against.
 325      *
 326      * @return true if the specified codesource is implied by this codesource,
 327      * false if not.
 328      */
 329     public boolean implies(CodeSource codesource)
 330     {
 331         if (codesource == null)
 332             return false;
 333 
 334         return matchCerts(codesource, false) && matchLocation(codesource);
 335     }
 336 
 337     /**
 338      * Returns true if all the certs in this


< prev index next >