Sha256: dcb7a663d5227eca2d84df6a20763d4d5f650f17abe5479488de6149794bd08b

Contents?: true

Size: 1.41 KB

Versions: 30

Compression:

Stored size: 1.41 KB

Contents

// Copyright 2000 Samuele Pedroni

package jxxload_help;

public class PathVFSJavaLoader extends ClassLoader {
    private ClassLoader parent;
   
    private PathVFS vfs;
    
    public java.util.Vector interfaces = new java.util.Vector();
    
    public PathVFSJavaLoader(PathVFS vfs,ClassLoader parent) {
        this.vfs = vfs;
        this.parent = parent;
    }
    
    protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
        Class c;
        
        c = findLoadedClass(name);
        if (c != null) return c;
        
        try {
            if (parent != null) return parent.loadClass(name);
        } catch(ClassNotFoundException e) {
        }
        
        java.io.InputStream in = vfs.open(name.replace('.','/')+".class");
        if (in == null) throw new ClassNotFoundException(name);
        try {
	    byte[] buf = org.python.core.FileUtil.readBytes( in );
            in.close();
            return loadClassFromBytes(name,buf);
        } catch(java.io.IOException e) {
            throw new ClassNotFoundException(name);
        }
    }

    private Class loadClassFromBytes(String name, byte[] data) {
        Class c = defineClass(name, data, 0, data.length);
        resolveClass(c);
        if (c.isInterface()) interfaces.addElement(c);
        if (!org.python.core.Options.skipCompile) {
            Compiler.compileClass(c);
        }
        return c;
    }
  
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rubyfox-server-2.19.2.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.17.3.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.17.3.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.17.3.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.16.3.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.16.3.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.16.0.4 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.16.0.3 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.16.0.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.16.0.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.16.0.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.13.7.3 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.13.6.2 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.13.6.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.13.5.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.13.4.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.13.3.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.12.5.1 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.12.5.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java
rubyfox-server-2.12.4.0 lib/rubyfox/server/data/lib/Lib/jxxload_help/PathVFSJavaLoader.java