Package com.cburch.logisim.util

Examples of com.cburch.logisim.util.ZipClassLoader


    // a custom-written class ZipClassLoader instead. The ZipClassLoader
    // is based on something downloaded off a forum, and I'm not as sure
    // that it works as well. It certainly does more file accesses.
   
    // Anyway, here's the line for this new version:
    ZipClassLoader loader = new ZipClassLoader(actual);
   
    // And here's the code that was present up until 2.1.8, and which I
    // know to work well except for the closing-files bit. If necessary, we
    // can revert by deleting the above declaration and reinstating the below.
    /*
    URL url;
    try {
      url = new URL("file", "localhost", file.getCanonicalPath());
    } catch (MalformedURLException e1) {
      throw new LoadFailedException("Internal error: Malformed URL");
    } catch (IOException e1) {
      throw new LoadFailedException(Strings.get("jarNotOpenedError"));
    }
    URLClassLoader loader = new URLClassLoader(new URL[] { url });
    */
   
    // load library class from loader
    Class<?> retClass;
    try {
      retClass = loader.loadClass(className);
    } catch (ClassNotFoundException e) {
      throw new LoadFailedException(StringUtil.format(Strings.get("jarClassNotFoundError"), className));
    }
    if (!(Library.class.isAssignableFrom(retClass))) {
      throw new LoadFailedException(StringUtil.format(Strings.get("jarClassNotLibraryError"), className));
View Full Code Here


        // a custom-written class ZipClassLoader instead. The ZipClassLoader
        // is based on something downloaded off a forum, and I'm not as sure
        // that it works as well. It certainly does more file accesses.

        // Anyway, here's the line for this new version:
        ZipClassLoader loader = new ZipClassLoader(actual);

        // And here's the code that was present up until 2.1.8, and which I
        // know to work well except for the closing-files bit. If necessary, we
        // can revert by deleting the above declaration and reinstating the below.
        /*
        URL url;
        try {
            url = new URL("file", "localhost", file.getCanonicalPath());
        } catch (MalformedURLException e1) {
            throw new LoadFailedException("Internal error: Malformed URL");
        } catch (IOException e1) {
            throw new LoadFailedException(Strings.get("jarNotOpenedError"));
        }
        URLClassLoader loader = new URLClassLoader(new URL[] { url });
        */

        // load library class from loader
        Class<?> retClass;
        try {
            retClass = loader.loadClass(className);
        } catch (ClassNotFoundException e) {
            logger.error( "Class not found" );
            throw new LoadFailedException(getFromLocale("jarClassNotFoundError", className));
        }
        if (!(Library.class.isAssignableFrom(retClass))) {
View Full Code Here

TOP

Related Classes of com.cburch.logisim.util.ZipClassLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.