Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.Resource


        // What would be cool is if we could maintain a cache of bundle id + locale -->
        // Resource. That would optimize quite a bit of this; may need to use an alternative to
        // LocalizedNameGenerator.

        Resource propertiesResource = bundle.getBaseResource().withExtension("properties");

        List<Resource> localizations = CollectionFactory.newList();

        for (String localizedFile : new LocalizedNameGenerator(propertiesResource.getFile(), locale))
        {
            Resource localized = propertiesResource.forFile(localizedFile);

            localizations.add(localized);
        }

        // We need them in least-specific to most-specific order, the opposite
View Full Code Here


        return new BytestreamCache(stream);
    }

    private void streamLibraryContent(Asset library, OutputStream outputStream) throws IOException
    {
        Resource resource = library.getResource();

        StreamableResource streamable = resourceCache.getStreamableResource(resource);

        InputStream inputStream = streamable.getStream(false);
View Full Code Here

        replay();

        forceCacheClear();

        Resource resource = simpleComponentResource.forFile("NoSuchAppCatalog.properties");
        List<Resource> resources = Arrays.asList(resource);

        ComponentMessagesSource source = new ComponentMessagesSourceImpl(resources, new PropertiesFileParserImpl(),
                converter);
View Full Code Here

        MessagesBundle parent = null;

        for (String bundle : bundles)
        {
            Resource bundleResource = classpathRoot.forFile(bundle);

            parent = new ValidationMessagesBundle(bundleResource, parent);
        }

        bundle = parent;
View Full Code Here

        MultiKey key = new MultiKey(componentName, locale);

        // First cache is key to resource.

        Resource resource = templateResources.get(key);

        if (resource == null)
        {
            resource = locateTemplateResource(componentModel, locale);
            templateResources.put(key, resource);
View Full Code Here

    private Resource locateTemplateResource(ComponentModel initialModel, Locale locale)
    {
        ComponentModel model = initialModel;
        while (model != null)
        {
            Resource localized = locator.locateTemplate(model, locale);

            if (localized != null)
                return localized;

            // Otherwise, this component doesn't have its own template ... lets work up to its
View Full Code Here

        URL url = new URL("http", "localhost", JETTY_PORT, "/assets/app1/pages/nested/tapestry-button.png");

        byte[] downloaded = readContent(url);

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

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

        assertEquals(downloaded, actual);
    }
View Full Code Here

        }

        // TODO: Check that the name is not already in the map. But I think that can't happen,
        // because the classloader itself is synchronized.

        Resource baseResource = new ClasspathResource(classname.replace(".", "/") + ".class");

        ComponentModel parentModel = nameToComponentModel.get(parentClassname);

        MutableComponentModel model = new MutableComponentModelImpl(classname, logger, baseResource, parentModel);
View Full Code Here

            return false;
        }

        final String expanded = symbolSource.expandSymbols(path.value());

        final Resource baseResource = componentModel.getBaseResource();

        ComputedValue<Asset> computedAsset = new ComputedValue<Asset>()
        {
            public Asset get(InstanceContext context)
            {
View Full Code Here

    @Test
    public void asset_client_URL_is_cached()
    {
        ResourceDigestManager digestManager = mockResourceResourceDigestManager();

        Resource r = new ClasspathResource("foo/Bar.txt");

        ClasspathAssetAliasManager aliasManager = mockClasspathAssetAliasManager();

        train_requiresDigest(digestManager, r, false);
View Full Code Here

TOP

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