86 public class URLClassPath { 87 private static final String USER_AGENT_JAVA_VERSION = "UA-Java-Version"; 88 private static final String JAVA_VERSION; 89 private static final boolean DEBUG; 90 private static final boolean DISABLE_JAR_CHECKING; 91 private static final boolean DISABLE_ACC_CHECKING; 92 private static final boolean DISABLE_CP_URL_CHECK; 93 private static final boolean DEBUG_CP_URL_CHECK; 94 95 static { 96 Properties props = GetPropertyAction.privilegedGetProperties(); 97 JAVA_VERSION = props.getProperty("java.version"); 98 DEBUG = (props.getProperty("sun.misc.URLClassPath.debug") != null); 99 String p = props.getProperty("sun.misc.URLClassPath.disableJarChecking"); 100 DISABLE_JAR_CHECKING = p != null ? p.equals("true") || p.isEmpty() : false; 101 102 p = props.getProperty("jdk.net.URLClassPath.disableRestrictedPermissions"); 103 DISABLE_ACC_CHECKING = p != null ? p.equals("true") || p.isEmpty() : false; 104 105 // This property will be removed in a later release 106 p = props.getProperty("jdk.net.URLClassPath.disableClassPathURLCheck", "true"); 107 108 DISABLE_CP_URL_CHECK = p != null ? p.equals("true") || p.isEmpty() : false; 109 DEBUG_CP_URL_CHECK = "debug".equals(p); 110 } 111 112 /* The original search path of URLs. */ 113 private final ArrayList<URL> path; 114 115 /* The deque of unopened URLs */ 116 private final ArrayDeque<URL> unopenedUrls; 117 118 /* The resulting search path of Loaders */ 119 private final ArrayList<Loader> loaders = new ArrayList<>(); 120 121 /* Map of each URL opened to its corresponding Loader */ 122 private final HashMap<String, Loader> lmap = new HashMap<>(); 123 124 /* The jar protocol handler to use when creating new URLs */ 125 private final URLStreamHandler jarHandler; 126 127 /* Whether this URLClassLoader has been closed yet */ 128 private boolean closed = false; 129 | 86 public class URLClassPath { 87 private static final String USER_AGENT_JAVA_VERSION = "UA-Java-Version"; 88 private static final String JAVA_VERSION; 89 private static final boolean DEBUG; 90 private static final boolean DISABLE_JAR_CHECKING; 91 private static final boolean DISABLE_ACC_CHECKING; 92 private static final boolean DISABLE_CP_URL_CHECK; 93 private static final boolean DEBUG_CP_URL_CHECK; 94 95 static { 96 Properties props = GetPropertyAction.privilegedGetProperties(); 97 JAVA_VERSION = props.getProperty("java.version"); 98 DEBUG = (props.getProperty("sun.misc.URLClassPath.debug") != null); 99 String p = props.getProperty("sun.misc.URLClassPath.disableJarChecking"); 100 DISABLE_JAR_CHECKING = p != null ? p.equals("true") || p.isEmpty() : false; 101 102 p = props.getProperty("jdk.net.URLClassPath.disableRestrictedPermissions"); 103 DISABLE_ACC_CHECKING = p != null ? p.equals("true") || p.isEmpty() : false; 104 105 // This property will be removed in a later release 106 p = props.getProperty("jdk.net.URLClassPath.disableClassPathURLCheck"); 107 DISABLE_CP_URL_CHECK = p != null ? p.equals("true") || p.isEmpty() : false; 108 109 // Print a message for each Class-Path entry that is ignored (assuming 110 // the check is not disabled). 111 p = props.getProperty("jdk.net.URLClassPath.showIgnoredClassPathEntries"); 112 DEBUG_CP_URL_CHECK = p != null ? p.equals("true") || p.isEmpty() : false; 113 } 114 115 /* The original search path of URLs. */ 116 private final ArrayList<URL> path; 117 118 /* The deque of unopened URLs */ 119 private final ArrayDeque<URL> unopenedUrls; 120 121 /* The resulting search path of Loaders */ 122 private final ArrayList<Loader> loaders = new ArrayList<>(); 123 124 /* Map of each URL opened to its corresponding Loader */ 125 private final HashMap<String, Loader> lmap = new HashMap<>(); 126 127 /* The jar protocol handler to use when creating new URLs */ 128 private final URLStreamHandler jarHandler; 129 130 /* Whether this URLClassLoader has been closed yet */ 131 private boolean closed = false; 132 |