Package org.apache.hivemind.util

Examples of org.apache.hivemind.util.ClasspathResource


    public void initialize()
    {
        Defense.notNull(_resolver, "Classpath Resolver");
        Defense.notNull(_scriptPath, "Script path");
       
        _script = new ClasspathResource(_resolver, _scriptPath);
    }
View Full Code Here


        Resource includeLocation = null;

        if (_resourcePath.startsWith("/"))
        {
            includeLocation =
                new ClasspathResource(new DefaultClassResolver(),
                    _resourcePath);
        }
        else
        {
            Resource baseLocation = session.getScriptTemplateResource();
View Full Code Here

    private void writeExternalScripts(IMarkupWriter writer, IRequestCycle cycle)
    {
        int count = Tapestry.size(_externalScripts);
        for (int i = 0; i < count; i++)
        {
            ClasspathResource scriptLocation = (ClasspathResource) _externalScripts.get(i);

            // This is still very awkward! Should move the code inside PrivateAsset somewhere
            // else, so that an asset does not have to be created to to build the URL.
            PrivateAsset asset = new PrivateAsset(scriptLocation, _assetService, null);
            String url = asset.buildURL(cycle);
View Full Code Here

        // is in the context root is problematic, cause getRelativeLocation()
        // will still be looking in the context. Handle this case with the
        // following little kludge:

        if (location.getResourceURL() == null && path.startsWith("/"))
            location = new ClasspathResource(_resolver, path);

        ILibrarySpecification ls = _specificationSource.getLibrarySpecification(location);

        return new Namespace(id, this, ls, _specificationSource, _resolver);
    }
View Full Code Here

       
        finalSymbols.put(FIELD_SYMBOL, field);
        finalSymbols.put(FORM_SYMBOL, form);
        finalSymbols.put(VALIDATOR_SYMBOL, this);
       
        Resource location = new ClasspathResource(new DefaultClassResolver(), scriptPath);
       
        IScript script = _scriptSource.getScript(location);

        // If there's an error, report it against the field (this validator object doesn't
        // have a location).
View Full Code Here

    Resource getScript(IComponent component)
    {
        if (IWidget.class.isInstance(component)) {
           
            if (_widgetResource == null)
                _widgetResource = new ClasspathResource(_resolver, _widgetScript);
           
            return _widgetResource;
        }
       
        if (Body.class.isInstance(component)) {
           
            if (_elementResource == null)
                _elementResource = new ClasspathResource(_resolver, _elementScript);
           
            return _elementResource;
        }
       
        if (_componentResource == null)
            _componentResource = new ClasspathResource(_resolver, _componentScript);
       
        return _componentResource;
    }
View Full Code Here

        finalSymbols.put(FIELD_SYMBOL, field);
        finalSymbols.put(FORM_SYMBOL, form);
        finalSymbols.put(VALIDATOR_SYMBOL, this);

        Resource location = new ClasspathResource(engine.getClassResolver(), scriptPath);

        IScript script = source.getScript(location);

        // If there's an error, report it against the field (this validator object doesn't
        // have a location).
View Full Code Here

    private ClassResolver _resolver = new DefaultClassResolver();

    private ScriptDescriptor parse(String file) throws Exception
    {
        String basePath = "/" + getClass().getName().replace('.', '/');
        Resource baseResource = new ClasspathResource(_resolver, basePath);

        Resource fileResource = baseResource.getRelativeResource(file);

        return new IntegrationTestScriptParser().parse(fileResource);
    }
View Full Code Here

{
    private ClassResolver _classResolver;

    public ClasspathResource newResource(String path)
    {
        return new ClasspathResource(_classResolver, path);
    }
View Full Code Here

        Resource includeLocation = null;

        if (_resourcePath.startsWith("/"))
        {
            includeLocation =
                new ClasspathResource(
                    session.getRequestCycle().getEngine().getClassResolver(),
                    _resourcePath);
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.apache.hivemind.util.ClasspathResource

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.