Package org.rascalmpl.uri

Examples of org.rascalmpl.uri.FileURIResolver


    eval = new Evaluator(ValueFactoryFactory.getValueFactory(), stderr, stdout, root, heap);
   
    URIResolverRegistry reg = eval.getResolverRegistry();
   
    if (isEditMode()) {
       FileURIResolver fileURIResolver = new FileURIResolver() {
        @Override
        public String scheme() {
          return "courses";
        }
       
        @Override
        protected String getPath(URI uri) {
          String path = uri.getPath();
          return getCoursesLocation() + (path.startsWith("/") ? path : ("/" + path));
        }
      };
     
      reg.registerInputOutput(fileURIResolver);
    }
    else {
      eval.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());
      reg.registerInput(new ClassResourceInput(reg, "courses", getClass(), "/org/rascalmpl/courses"));
    }
   
    eval.addRascalSearchPath(URIUtil.rootScheme("tutor"));
    eval.addRascalSearchPath(URIUtil.rootScheme("courses"));

    for (final String lib : new String[] { "rascal", "rascal-eclipse" }) {
      final String libSrc = System.getProperty("rascal.courses.lib." + lib);

      if (libSrc != null) {
        FileURIResolver fileURIResolver = new FileURIResolver() {
          @Override
          public String scheme() {
            return "clib-" + lib;
          }
View Full Code Here


    if (stdout == null) {
      throw new NullPointerException();
    }
   
    // register some schemes
    FileURIResolver files = new FileURIResolver();
    resolverRegistry.registerInputOutput(files);

    HttpURIResolver http = new HttpURIResolver();
    resolverRegistry.registerInput(http);
   
    //added
    HttpsURIResolver https = new HttpsURIResolver();
    resolverRegistry.registerInput(https);

    CWDURIResolver cwd = new CWDURIResolver();
    resolverRegistry.registerInputOutput(cwd);

    ClassResourceInput library = new ClassResourceInput(resolverRegistry, "std", getClass(), "/org/rascalmpl/library");
    resolverRegistry.registerInput(library);

    ClassResourceInput testdata = new ClassResourceInput(resolverRegistry, "testdata", getClass(), "/org/rascalmpl/test/data");
    resolverRegistry.registerInput(testdata);
   
    ClassResourceInput benchmarkdata = new ClassResourceInput(resolverRegistry, "benchmarks", getClass(), "/org/rascalmpl/benchmark");
    resolverRegistry.registerInput(benchmarkdata);
   
    resolverRegistry.registerInput(new JarURIResolver());

    resolverRegistry.registerInputOutput(rascalPathResolver);

    resolverRegistry.registerInputOutput(new HomeURIResolver());
    resolverRegistry.registerInputOutput(new TempURIResolver());
   
    // here we have code that makes sure that courses can be edited by
    // maintainers of Rascal, using the -Drascal.courses=/path/to/courses property.
    final String courseSrc = System.getProperty("rascal.courses");
    if (courseSrc != null) {
       FileURIResolver fileURIResolver = new FileURIResolver() {
        @Override
        public String scheme() {
          return "courses";
        }
       
View Full Code Here

TOP

Related Classes of org.rascalmpl.uri.FileURIResolver

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.