/[classpath]/gjdoc/src/gnu/classpath/tools/FileSystemClassLoader.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/FileSystemClassLoader.java

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

revision 1.2 by julian, Tue Dec 7 15:00:01 2004 UTC revision 1.3 by julian, Wed Dec 8 14:58:19 2004 UTC
# Line 64  public class FileSystemClassLoader exten Line 64  public class FileSystemClassLoader exten
64           if (pathComponent.exists() && !pathComponent.isDirectory()) {           if (pathComponent.exists() && !pathComponent.isDirectory()) {
65              List subComponents = tryGetJarFileClassPathComponents(pathComponent);              List subComponents = tryGetJarFileClassPathComponents(pathComponent);
66              if (null != subComponents) {              if (null != subComponents) {
                System.err.println("have subComponents: " + subComponents);  
67                 components.addAll(subComponents);                 components.addAll(subComponents);
68              }              }
69           }           }
# Line 103  public class FileSystemClassLoader exten Line 102  public class FileSystemClassLoader exten
102    
103     public URL findResource(String name)     public URL findResource(String name)
104     {     {
       System.err.println("FileSystemClassLoader.findResource called with " + name);  
105        StreamInfo streamInfo = getResourceStream(name);        StreamInfo streamInfo = getResourceStream(name);
106        if (null == streamInfo) {        if (null == streamInfo) {
107           return super.findResource(name);           return super.findResource(name);
108        }        }
109        else {        else {
110           try {           try {
             //System.err.println("found resource at " + streamInfo.getURL());  
111              return streamInfo.getURL();              return streamInfo.getURL();
112           }           }
113           catch (MalformedURLException e) {           catch (MalformedURLException e) {
# Line 261  public class FileSystemClassLoader exten Line 258  public class FileSystemClassLoader exten
258        throw new ClassNotFoundException(className);        throw new ClassNotFoundException(className);
259     }     }
260    
    /*  
       try {  
          String classFileName = className.replace('.', File.separatorChar) + ".class";  
           
          for (int i = 0; i < pathComponents.length; ++i) {  
             try {  
                File parent = pathComponents[i];  
                if (parent.isDirectory()) {  
                   File file = new File(parent, classFileName);  
                   if (file.exists()) {  
                      return readFromStream(new FileInputStream(file), file.length());  
                   }  
                }  
                else {  
                   JarFile jarFile = new JarFile(parent, false, JarFile.OPEN_READ);  
                   JarEntry jarEntry = jarFile.getJarEntry(classFileName);  
                   if (null != jarEntry) {  
                      return readFromStream(jarFile.getInputStream(jarEntry),  
                                            jarEntry.getSize());  
                   }  
                   else {  
                      Manifest manifest = jarFile.getManifest();  
                      Attributes classpathAttributes = manifest.getAttributes("Class-Path");  
                      if (null != classpathAttributes) {  
                         System.err.println("classpathAttributes: " + classpathAttributes);  
                      }  
                   }  
                }  
             }  
             catch (FileNotFoundException ignore) {  
             }  
          }  
       }  
       catch (IOException ignore_) {  
       }  
       throw new ClassNotFoundException(className);  
    }  
    */  
   
261     private static List tryGetJarFileClassPathComponents(File file)     private static List tryGetJarFileClassPathComponents(File file)
262     {     {
263        try {        try {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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