Package org.apache.sling.api.resource

Examples of org.apache.sling.api.resource.ResourceProvider


            log.debug("bindResourceProvider: Binding {}", serviceName);
           
            String[] roots = OsgiUtil.toStringArray(reference.getProperty(ResourceProvider.ROOTS));
            if (roots != null && roots.length > 0) {

                ResourceProvider provider = (ResourceProvider) componentContext.locateService(
                    "ResourceProvider", reference);

                // synchronized insertion of new resource providers into
                // the tree to not inadvertandly loose an entry
                synchronized (this) {
View Full Code Here


            "/apps/sling/microsling/html.js"));
    }

    public void testAdd1Provider() {
        String firstPath = "/rootel";
        ResourceProvider first = new TestResourceProvider(firstPath);
        root.addResourceProvider(firstPath, first);

        assertEquals(root, root.getResource(null, "/"));
        assertEquals(first, root.getResource(null, "/rootel"));
        assertEquals(first, root.getResource(null, "/rootel/html.js"));
View Full Code Here

    public void testAdd3Providers() {
        String firstPath = "/rootel";
        String thirdPath = "/apps/sling/sample";
        String secondPath = firstPath + "/child";

        ResourceProvider first = new TestResourceProvider(firstPath);
        ResourceProvider second = new TestResourceProvider(secondPath);
        ResourceProvider third = new TestResourceProvider(thirdPath);

        root.addResourceProvider(firstPath, first);
        root.addResourceProvider(secondPath, second);
        root.addResourceProvider(thirdPath, third);
View Full Code Here

    public void testAdd3ProvidersReverse() {
        String firstPath = "/rootel";
        String thirdPath = "/apps/sling/sample";
        String secondPath = firstPath + "/child";

        ResourceProvider first = new TestResourceProvider(firstPath);
        ResourceProvider second = new TestResourceProvider(secondPath);
        ResourceProvider third = new TestResourceProvider(thirdPath);

        root.addResourceProvider(thirdPath, third);
        root.addResourceProvider(secondPath, second);
        root.addResourceProvider(firstPath, first);
View Full Code Here

    public void testRemoveProviders() {
        String firstPath = "/rootel";
        String thirdPath = "/apps/sling/sample";
        String secondPath = firstPath + "/child";

        ResourceProvider first = new TestResourceProvider(firstPath);
        ResourceProvider second = new TestResourceProvider(secondPath);
        ResourceProvider third = new TestResourceProvider(thirdPath);

        root.addResourceProvider(firstPath, first);
        root.addResourceProvider(secondPath, second);
        root.addResourceProvider(thirdPath, third);
View Full Code Here

            private Resource seek() {
                for (;;) {
                    while ((resources == null || !resources.hasNext())
                        && providers.hasNext()) {
                        ResourceProvider provider = providers.next();
                        resources = provider.listChildren(resource);
                    }

                    if (resources != null && resources.hasNext()) {
                        Resource res = resources.next();
                        String resPath = res.getPath();
View Full Code Here

TOP

Related Classes of org.apache.sling.api.resource.ResourceProvider

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.