817 JarIndex getIndex() {
818 try {
819 ensureOpen();
820 } catch (IOException e) {
821 throw new InternalError(e);
822 }
823 return index;
824 }
825
826 /*
827 * Creates the resource and if the check flag is set to true, checks if
828 * is its okay to return the resource.
829 */
830 Resource checkResource(final String name, boolean check,
831 final JarEntry entry) {
832
833 final URL url;
834 try {
835 String nm;
836 if (jar.isMultiRelease()) {
837 nm = SharedSecrets.javaUtilJarAccess().getRealName(jar, entry);
838 } else {
839 nm = name;
840 }
841 url = new URL(getBaseURL(), ParseUtil.encodePath(nm, false));
842 if (check) {
843 URLClassPath.check(url);
844 }
845 } catch (MalformedURLException e) {
846 return null;
847 // throw new IllegalArgumentException("name");
848 } catch (IOException e) {
849 return null;
850 } catch (AccessControlException e) {
851 return null;
852 }
853
854 return new Resource() {
855 public String getName() { return name; }
856 public URL getURL() { return url; }
857 public URL getCodeSourceURL() { return csu; }
|
817 JarIndex getIndex() {
818 try {
819 ensureOpen();
820 } catch (IOException e) {
821 throw new InternalError(e);
822 }
823 return index;
824 }
825
826 /*
827 * Creates the resource and if the check flag is set to true, checks if
828 * is its okay to return the resource.
829 */
830 Resource checkResource(final String name, boolean check,
831 final JarEntry entry) {
832
833 final URL url;
834 try {
835 String nm;
836 if (jar.isMultiRelease()) {
837 nm = entry.getRealName();
838 } else {
839 nm = name;
840 }
841 url = new URL(getBaseURL(), ParseUtil.encodePath(nm, false));
842 if (check) {
843 URLClassPath.check(url);
844 }
845 } catch (MalformedURLException e) {
846 return null;
847 // throw new IllegalArgumentException("name");
848 } catch (IOException e) {
849 return null;
850 } catch (AccessControlException e) {
851 return null;
852 }
853
854 return new Resource() {
855 public String getName() { return name; }
856 public URL getURL() { return url; }
857 public URL getCodeSourceURL() { return csu; }
|