/[classpath]/classpath/java/net/URLClassLoader.java
ViewVC logotype

Diff of /classpath/java/net/URLClassLoader.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by green, Sat Sep 17 04:22:08 2005 UTC revision 1.39 by jfrijters, Sat Oct 1 11:04:11 2005 UTC
# Line 235  public class URLClassLoader extends Secu Line 235  public class URLClassLoader extends Secu
235    abstract static class Resource    abstract static class Resource
236    {    {
237      final URLLoader loader;      final URLLoader loader;
     final String name;  
238    
239      Resource(URLLoader loader, String name)      Resource(URLLoader loader)
240      {      {
241        this.loader = loader;        this.loader = loader;
       this.name = name;  
242      }      }
243    
244      /**      /**
# Line 391  public class URLClassLoader extends Secu Line 389  public class URLClassLoader extends Secu
389    static final class JarURLResource extends Resource    static final class JarURLResource extends Resource
390    {    {
391      private final JarEntry entry;      private final JarEntry entry;
392        private final String name;
393    
394      JarURLResource(JarURLLoader loader, String name, JarEntry entry)      JarURLResource(JarURLLoader loader, String name, JarEntry entry)
395      {      {
396        super(loader, name);        super(loader);
397        this.entry = entry;        this.entry = entry;
398          this.name = name;
399      }      }
400    
401      InputStream getInputStream() throws IOException      InputStream getInputStream() throws IOException
# Line 496  public class URLClassLoader extends Secu Line 496  public class URLClassLoader extends Secu
496      RemoteResource(RemoteURLLoader loader, String name, URL url,      RemoteResource(RemoteURLLoader loader, String name, URL url,
497                     InputStream stream, int length)                     InputStream stream, int length)
498      {      {
499        super(loader, name);        super(loader);
500        this.url = url;        this.url = url;
501        this.stream = stream;        this.stream = stream;
502        this.length = length;        this.length = length;
# Line 539  public class URLClassLoader extends Secu Line 539  public class URLClassLoader extends Secu
539          {          {
540            File file = new File(dir, name).getCanonicalFile();            File file = new File(dir, name).getCanonicalFile();
541            if (file.exists() && !file.isDirectory())            if (file.exists() && !file.isDirectory())
542              return new FileResource(this, file.getPath(), file);              return new FileResource(this, file);
543          }          }
544        catch (IOException e)        catch (IOException e)
545          {          {
# Line 553  public class URLClassLoader extends Secu Line 553  public class URLClassLoader extends Secu
553    {    {
554      final File file;      final File file;
555    
556      FileResource(FileURLLoader loader, String name, File file)      FileResource(FileURLLoader loader, File file)
557      {      {
558        super(loader, name);        super(loader);
559        this.file = file;        this.file = file;
560      }      }
561    
# Line 573  public class URLClassLoader extends Secu Line 573  public class URLClassLoader extends Secu
573      {      {
574        try        try
575          {          {
576            return new URL(loader.baseURL, name,            return file.toURL();
                          loader.classloader.getURLStreamHandler("file"));  
577          }          }
578        catch (MalformedURLException e)        catch (MalformedURLException e)
579          {          {

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26