Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.Resource.toURL()


        // No line number? then nothing more to render.

        if (line <= 0) return;

        URL url = r.toURL();

        if (url == null) return;

        int start = line - RANGE;
        int end = line + RANGE;
View Full Code Here


    @Test
    public void get_URL_for_missing_resource() throws Exception
    {
        Resource r = new ClasspathResource(FOLDER + "/missing-resource.txt");

        assertNull(r.toURL());
    }

    @Test
    public void localization_of_resource() throws Exception
    {
View Full Code Here

    public void with_extension_missing_resource_is_null()
    {
        Resource r = new ClasspathResource(PATH);
        Resource e = r.withExtension("does-not-exist");

        assertNull(e.toURL());
    }

    @Test
    public void localization_of_missing_resource() throws Exception
    {
View Full Code Here

    {
        for (String path : new LocalizedNameGenerator(_path, locale))
        {
            Resource potential = createResource(path);

            URL url = potential.toURL();

            if (url != null) return potential;
        }

        return null;
View Full Code Here

        Resource resource = findResourceAndValidateDigest(response, resourcePath);

        if (resource == null) return true;

        URL url = resource.toURL();

        if (url == null)
        {
            response.sendError(HttpServletResponse.SC_NOT_FOUND, ServicesMessages
                    .assetDoesNotExist(resource));
View Full Code Here

        byte[] downloaded = readContent(url);

        Resource classpathResource = new ClasspathResource(
                "org/apache/tapestry/integration/app1/pages/nested/tapestry-button.png");

        byte[] actual = readContent(classpathResource.toURL());

        assertEquals(downloaded, actual);
    }

    /**
 
View Full Code Here

        byte[] downloaded = readContent(url);

        Resource classpathResource = new ClasspathResource(
                "org/apache/tapestry/integration/app1/pages/tapestry-button.png");

        byte[] actual = readContent(classpathResource.toURL());

        assertEquals(downloaded, actual);
    }

    @Test
View Full Code Here

        replay();

        Resource r = new ContextResource(context, "foo/Bar.txt");

        assertSame(r.toURL(), url);

        verify();
    }

    @Test
View Full Code Here

        byte[] downloaded = readContent(url);

        Resource classpathResource = new ClasspathResource(
                "org/apache/tapestry/integration/app1/pages/tapestry-button.png");

        byte[] actual = readContent(classpathResource.toURL());

        assertEquals(downloaded, actual);
    }

    @Test
View Full Code Here

    {
        final Resource appCatalogResource = _rootResource.forFile(_appCatalog);

        // If the application catalog exists, set it up as the root, otherwise use null.

        MessagesBundle appCatalogBundle = appCatalogResource.toURL() == null ? null
                : new MessagesBundle()
                {
                    public Resource getBaseResource()
                    {
                        return appCatalogResource;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.