Package org.nlogo.api

Examples of org.nlogo.api.ExtensionException


      try {
        String fullPath = workspace.fileManager().attachPrefix(path);
        if (org.nlogo.api.RemoteFile.exists(fullPath)) {
          return fullPath;
        } else {
          throw new ExtensionException("Can't find file " + path + " using " + fullPath);
        }
      } catch (java.net.MalformedURLException ex) {
        throw new ExtensionException(path + " is not a valid pathname: " + ex);
      }
    }

    try {
      String fullPath = workspace.attachModelDir(path);
      java.io.File f = new java.io.File(fullPath);
      if (f.exists()) {
        return fullPath;
      }
    } catch (java.net.MalformedURLException ex) {
      org.nlogo.util.Exceptions.ignore(ex);
    }

    // Then try the extensions folder
    java.io.File f = new java.io.File("extensions" + java.io.File.separator + path);
    if (f.exists()) {
      return f.getPath();
    }

    // Give up
    throw new ExtensionException("Can't find file " + path);
  }
View Full Code Here

TOP

Related Classes of org.nlogo.api.ExtensionException

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.