Package org.apache.hivemind

Examples of org.apache.hivemind.Resource


        replayControls();

        ContextResource r1 = new ContextResource(context, "/foo/bar/baz.html");

        Resource r2 = r1.getLocalization(Locale.ENGLISH);

        assertEquals("/foo/bar/baz_en.html", r2.getPath());
        assertEquals(Locale.ENGLISH, r2.getLocale());

        verifyControls();
    }
View Full Code Here


        replayControls();

        ContextResource r1 = new ContextResource(context, "/foo/bar/baz.html");

        Resource r2 = r1.getLocalization(Locale.ENGLISH);

        assertSame(r2, r1);

        verifyControls();
    }
View Full Code Here

        ServletContext context = newContext();

        replayControls();

        ContextResource r1 = new ContextResource(context, "/foo/bar/baz.html");
        Resource r2 = r1.getRelativeResource("baz.gif");

        assertEquals("/foo/bar/baz.gif", r2.getPath());

        verifyControls();
    }
View Full Code Here

        _processor = getResourceProcessor(_resolver, handler);

        for (Iterator i = _resources.iterator(); i.hasNext();)
        {
            Resource resource = (Resource) i.next();

            processResource(resource);
        }

        _processor = null;
View Full Code Here

        for (Iterator i = subModules.iterator(); i.hasNext();)
        {
            SubModuleDescriptor smd = (SubModuleDescriptor) i.next();

            Resource descriptorResource = smd.getDescriptor();

            if (descriptorResource.getResourceURL() == null)
            {
                _errorHandler.error(
                        LOG,
                        ImplMessages.subModuleDoesNotExist(descriptorResource),
                        smd.getLocation(),
View Full Code Here

        if (HiveMind.isBlank(inputValue))
            return null;

        Locale locale = contributingModule.getLocale();

        Resource descriptor = contributingModule.getLocation().getResource();

        Resource baseResource = descriptor.getRelativeResource(inputValue);

        Resource result = baseResource.getLocalization(locale);

        if (result == null)
            throw new ApplicationRuntimeException(
                RulesMessages.resourceLocalizationError(inputValue, contributingModule));
View Full Code Here

        push(elementName, smd, STATE_NO_CONTENT);

        checkAttributes();

        Resource descriptor = getResource().getRelativeResource(getAttribute("descriptor"));

        smd.setDescriptor(descriptor);

        md.addSubModule(smd);
    }
View Full Code Here

            return;
        }

        String path = file.getPath().replace('\\', '/');

        Resource r = new FileResource(path);

        enqueue(r);
    }
View Full Code Here

    private void enqueueJar(File jarFile) throws IOException
    {
        URL jarRootURL = new URL("jar:" + jarFile.toURL() + "!/");

        Resource jarResource = new URLResource(jarRootURL);

        enqueueIfExists(jarResource, XmlModuleDescriptorProvider.HIVE_MODULE_XML);
    }
View Full Code Here

        enqueueIfExists(jarResource, XmlModuleDescriptorProvider.HIVE_MODULE_XML);
    }

    private void enqueueIfExists(Resource jarResource, String path)
    {
        Resource r = jarResource.getRelativeResource(path);

        if (r.getResourceURL() != null)
            enqueue(r);
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.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.