533 * |
533 * |
534 * @revised 9 |
534 * @revised 9 |
535 * @spec JPMS |
535 * @spec JPMS |
536 */ |
536 */ |
537 protected Package definePackage(String name, Manifest man, URL url) { |
537 protected Package definePackage(String name, Manifest man, URL url) { |
538 String path = name.replace('.', '/').concat("/"); |
|
539 String specTitle = null, specVersion = null, specVendor = null; |
538 String specTitle = null, specVersion = null, specVendor = null; |
540 String implTitle = null, implVersion = null, implVendor = null; |
539 String implTitle = null, implVersion = null, implVendor = null; |
541 String sealed = null; |
540 String sealed = null; |
542 URL sealBase = null; |
541 URL sealBase = null; |
543 |
542 |
544 Attributes attr = man.getAttributes(path); |
543 Attributes attr = SharedSecrets.javaUtilJarAccess() |
|
544 .getTrustedAttributes(man, name.replace('.', '/').concat("/")); |
545 if (attr != null) { |
545 if (attr != null) { |
546 specTitle = attr.getValue(Name.SPECIFICATION_TITLE); |
546 specTitle = attr.getValue(Name.SPECIFICATION_TITLE); |
547 specVersion = attr.getValue(Name.SPECIFICATION_VERSION); |
547 specVersion = attr.getValue(Name.SPECIFICATION_VERSION); |
548 specVendor = attr.getValue(Name.SPECIFICATION_VENDOR); |
548 specVendor = attr.getValue(Name.SPECIFICATION_VENDOR); |
549 implTitle = attr.getValue(Name.IMPLEMENTATION_TITLE); |
549 implTitle = attr.getValue(Name.IMPLEMENTATION_TITLE); |
583 } |
583 } |
584 |
584 |
585 /* |
585 /* |
586 * Returns true if the specified package name is sealed according to the |
586 * Returns true if the specified package name is sealed according to the |
587 * given manifest. |
587 * given manifest. |
|
588 * |
|
589 * @throws SecurityException if the package name is untrusted in the manifest |
588 */ |
590 */ |
589 private boolean isSealed(String name, Manifest man) { |
591 private boolean isSealed(String name, Manifest man) { |
590 String path = name.replace('.', '/').concat("/"); |
592 Attributes attr = SharedSecrets.javaUtilJarAccess() |
591 Attributes attr = man.getAttributes(path); |
593 .getTrustedAttributes(man, name.replace('.', '/').concat("/")); |
592 String sealed = null; |
594 String sealed = null; |
593 if (attr != null) { |
595 if (attr != null) { |
594 sealed = attr.getValue(Name.SEALED); |
596 sealed = attr.getValue(Name.SEALED); |
595 } |
597 } |
596 if (sealed == null) { |
598 if (sealed == null) { |