1:
8:
9: package ;
10:
11: import ;
12: import ;
13: import ;
14: import ;
15: import ;
16: import ;
17: import ;
18:
19:
23: public final class Load_gcjlib extends URLLoader
24: {
25: private SharedLibHelper helper;
26:
27: public Load_gcjlib(URLClassLoader classloader,
28: URLStreamHandlerCache cache,
29: URLStreamHandlerFactory factory,
30: URL url, URL absoluteUrl)
31: {
32: super(classloader, cache, factory, url, absoluteUrl);
33: helper = SharedLibHelper.findHelper(classloader, url.getFile(),
34: noCertCodeSource, true);
35: }
36:
37: public Class getClass(String className)
38: {
39: return helper.findClass(className);
40: }
41:
42: public Resource getResource(String name)
43: {
44: URL url = helper.findResource(name);
45: if (url == null)
46: return null;
47: return new SoResource(this, url);
48: }
49:
50: final static class SoResource extends Resource
51: {
52: private final URL url;
53:
54: SoResource(Load_gcjlib loader, URL url)
55: {
56: super(loader);
57: this.url = url;
58: }
59:
60: public InputStream getInputStream() throws IOException
61: {
62: URLConnection conn = url.openConnection();
63: return conn.getInputStream();
64: }
65:
66: public int getLength()
67: {
68:
69: return -1;
70: }
71:
72: public URL getURL ()
73: {
74: return url;
75: }
76: }
77: }