|
12 | 12 |
|
13 | 13 | package clojure.lang; |
14 | 14 |
|
15 | | -import java.net.*; |
| 15 | +import java.net.MalformedURLException; |
16 | 16 | import java.util.concurrent.atomic.AtomicInteger; |
17 | 17 | import java.util.concurrent.Callable; |
18 | 18 | import java.util.*; |
19 | 19 | import java.util.regex.Matcher; |
20 | 20 | import java.util.regex.Pattern; |
21 | 21 | import java.io.*; |
22 | 22 | import java.lang.reflect.Array; |
23 | | -import java.lang.IllegalArgumentException; |
24 | 23 | import java.math.BigDecimal; |
25 | 24 | import java.math.BigInteger; |
26 | 25 | import java.security.AccessController; |
27 | 26 | import java.security.PrivilegedAction; |
| 27 | +import java.net.URL; |
| 28 | +import java.net.JarURLConnection; |
28 | 29 | import java.nio.charset.Charset; |
| 30 | +import java.net.URLConnection; |
29 | 31 |
|
30 | 32 | public class RT{ |
31 | 33 |
|
@@ -291,16 +293,8 @@ private Object readResolve() throws ObjectStreamException { |
291 | 293 |
|
292 | 294 | static AtomicInteger id = new AtomicInteger(1); |
293 | 295 |
|
294 | | -static public URL toUrl(String url) throws URISyntaxException, MalformedURLException { |
295 | | - return new URI(url).toURL(); |
296 | | -} |
297 | | - |
298 | | -static public URL toUrl(File file) throws MalformedURLException { |
299 | | - return file.toURI().toURL(); |
300 | | -} |
301 | | - |
302 | | -static public void addURL(Object url) throws MalformedURLException, URISyntaxException, IllegalArgumentException { |
303 | | - URL u = (url instanceof String) ? toUrl((String) url) : (URL) url; |
| 296 | +static public void addURL(Object url) throws MalformedURLException{ |
| 297 | + URL u = (url instanceof String) ? (new URL((String) url)) : (URL) url; |
304 | 298 | ClassLoader ccl = Thread.currentThread().getContextClassLoader(); |
305 | 299 | if(ccl instanceof DynamicClassLoader) |
306 | 300 | ((DynamicClassLoader)ccl).addURL(u); |
|
0 commit comments