670 /*
671 * close this loader and release all resources
672 * method overridden in sub-classes
673 */
674 @Override
675 public void close() throws IOException {
676 if (jarfile != null) {
677 jarfile.close();
678 }
679 }
680
681 /*
682 * Returns the local class path for this loader, or null if none.
683 */
684 URL[] getClassPath() throws IOException {
685 return null;
686 }
687 }
688
689 /*
690 * Nested class class used to represent a Loader of resources from a JAR URL.
691 */
692 static class JarLoader extends Loader {
693 private JarFile jar;
694 private final URL csu;
695 private JarIndex index;
696 private URLStreamHandler handler;
697 private final HashMap<String, Loader> lmap;
698 private final AccessControlContext acc;
699 private boolean closed = false;
700 private static final JavaUtilZipFileAccess zipAccess =
701 SharedSecrets.getJavaUtilZipFileAccess();
702
703 /*
704 * Creates a new JarLoader for the specified URL referring to
705 * a JAR file.
706 */
707 JarLoader(URL url, URLStreamHandler jarHandler,
708 HashMap<String, Loader> loaderMap,
709 AccessControlContext acc)
710 throws IOException
|
670 /*
671 * close this loader and release all resources
672 * method overridden in sub-classes
673 */
674 @Override
675 public void close() throws IOException {
676 if (jarfile != null) {
677 jarfile.close();
678 }
679 }
680
681 /*
682 * Returns the local class path for this loader, or null if none.
683 */
684 URL[] getClassPath() throws IOException {
685 return null;
686 }
687 }
688
689 /*
690 * Nested class used to represent a Loader of resources from a JAR URL.
691 */
692 static class JarLoader extends Loader {
693 private JarFile jar;
694 private final URL csu;
695 private JarIndex index;
696 private URLStreamHandler handler;
697 private final HashMap<String, Loader> lmap;
698 private final AccessControlContext acc;
699 private boolean closed = false;
700 private static final JavaUtilZipFileAccess zipAccess =
701 SharedSecrets.getJavaUtilZipFileAccess();
702
703 /*
704 * Creates a new JarLoader for the specified URL referring to
705 * a JAR file.
706 */
707 JarLoader(URL url, URLStreamHandler jarHandler,
708 HashMap<String, Loader> loaderMap,
709 AccessControlContext acc)
710 throws IOException
|