Package org.raptorjs.resources

Examples of org.raptorjs.resources.Resource


        return this.resource;
    }
   
    @Override
    public boolean exists(ResourceIncluderContext context) {
        Resource resource = this.getResource(context.getResourceManager());
        return resource != null;
    }
View Full Code Here


    }
   
    public PackageManifest getPackageManifestCached(String packagePath) {
        PackageManifest manifest = this.cachedManifests.get(packagePath);
        if (manifest == null) {
            Resource resource = this.resourceManager.findResource(packagePath);
            manifest = this.getPackageManifestCached(resource);
        }
        return manifest;
    }
View Full Code Here

    }
   
    public PackageManifest getModulePackageManifestCached(String moduleName) {
        PackageManifest manifest = this.cachedManifests.get(moduleName);
        if (manifest == null) {
            Resource resource = this.resourceManager.findResource("/" + moduleName.replace('.', '/') + "/package.json");
            if (resource == null) {
                resource = this.resourceManager.findResource("/" + moduleName.replace('.', '/') + "-package.json");
            }
            if (resource == null) {
                throw new RuntimeException("Package manifest not found for module \"" + moduleName + "\"");
View Full Code Here

    public Resource resolveResource(String path, ResourceManager resourceManager) {
        String fullPath = path.startsWith("/") ?
                path :
                this.getModuleDirPath() + "/" + path;
       
        Resource resource = resourceManager.findResource(fullPath);
        if (resource == null) {
            throw new RuntimeException("Dependency with path '" + path + "' (" + fullPath + ") not found for packge '" + this.getPackagePath() + "'.");
        }
        return resource;
    }
View Full Code Here

    }
   
    if (urls != null) {
      while (urls.hasMoreElements()) {
          URL url = urls.nextElement();
          Resource resource = new URLResource(path, this, fullPath, url, true);
          callback.resourceFound(resource);
        }
    }
    }
View Full Code Here

    public ResourcesRhinoHelper(RaptorJSEnv jsEnv) {
        this.resourceManager = jsEnv.getResourceManager();
    }
   
    public Resource findResource(String path) {
        Resource resource = this.resourceManager.findResource(path);
        return resource;
    }
View Full Code Here

    includeFactory.registerIncludeType("js", IncludeJSTest.class);
    includeFactory.registerIncludeType("4cc", Include4ccTest.class);
    includeFactory.registerIncludeType("less", IncludeLessTest.class);
    PackageManifestJSONLoader loader = new PackageManifestJSONLoader(includeFactory);
    InputStream in = PackageManifestJSONLoaderTest.class.getResourceAsStream("/packaging/test/tablet-web-package.json");
    Resource resource = new FileResource(".", null, new File("."));
    PackageManifest manifest = new PackageManifest();
    manifest.setResource(resource);
    loader.load(manifest, in);
    List<Extension> extensions = manifest.getExtensions();
    assertEquals(extensions.size(), 1);
View Full Code Here

TOP

Related Classes of org.raptorjs.resources.Resource

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.