Package net.feed_the_beast.launcher.json.assets

Examples of net.feed_the_beast.launcher.json.assets.AssetIndex$Asset


    {
        List<Asset> result = CollectionFactory.newList();

        for (String assetPath : assetPaths)
        {
            Asset asset = assetSource.getAsset(baseResource, assetPath, locale);

            result.add(asset);
        }

        return result;
View Full Code Here


        return getAssetForResource(localized);
    }

    private Asset getAssetForResource(Resource resource)
    {
        Asset result = cache.get(resource);

        if (result == null)
        {
            result = createAssetFromResource(resource);
            cache.put(resource, result);
View Full Code Here

        return expand(path, locale);
    }

    public List<Asset> getJavascriptStack()
    {
        Asset messages = assetSource.getAsset(null, "org/apache/tapestry5/tapestry-messages.js", threadLocale
                .getLocale());

        return createStack(javaScriptStack, messages, consoleJavaScript);
    }
View Full Code Here

            {
                Locale locale = resources.getLocale();

                for (String assetPath : paths)
                {
                    Asset asset = assetSource.getAsset(baseResource, assetPath, locale);

                    handleAsset(asset);
                }
            }
        };
View Full Code Here

    }

    public Binding newBinding(String description, ComponentResources container, ComponentResources component,
                              String expression, Location location)
    {
        Asset asset = source.getContextAsset(expression, container.getLocale());

        return new AssetBinding(location, description, asset);
    }
View Full Code Here

    public Binding newBinding(String description, ComponentResources container, ComponentResources component,
                              String expression, Location location)
    {
        Resource baseResource = container.getBaseResource();

        Asset asset = source.getAsset(baseResource, expression, container.getLocale());

        return new AssetBinding(location, description, asset);
    }
View Full Code Here

        replay();

        AssetFactory factory = new ContextAssetFactory(request, context, "4.5.6", new IdentityAssetPathConverter());

        Asset asset = factory.createAsset(r);

        assertSame(asset.getResource(), r);
        assertEquals(asset.toClientURL(), "/context/assets/ctx/4.5.6/foo/Bar.txt");

        // In real life, toString() is the same as toClientURL(), but we're testing
        // that the optimize method is getting called, basically.

        assertEquals(asset.toString(), "/context/assets/ctx/4.5.6/foo/Bar.txt");

        verify();
    }
View Full Code Here

        replay();

        ClasspathAssetFactory factory = new ClasspathAssetFactory(cache, aliasManager,
                                                                  converter);

        Asset asset = factory.createAsset(r);

        assertEquals(asset.toClientURL(), expectedClientURL);

        // Now, to check the cache:

        assertEquals(asset.toClientURL(), expectedClientURL);

        verify();

        // Now, to test cache clearing:
        train_requiresDigest(cache, r, false);

        train_toClientURL(aliasManager, "foo/Bar.txt", expectedClientURL);

        replay();

        factory.objectWasInvalidated();

        assertEquals(asset.toClientURL(), expectedClientURL);

        verify();
    }
View Full Code Here

        replay();

        AssetFactory factory = new ClasspathAssetFactory(cache, aliasManager, new IdentityAssetPathConverter());

        Asset asset = factory.createAsset(r);

        assertSame(asset.getResource(), r);
        assertEquals(asset.toClientURL(), expectedClientURL);
        assertEquals(asset.toString(), expectedClientURL);

        verify();
    }
View Full Code Here

        replay();

        AssetFactory factory = new ClasspathAssetFactory(cache, aliasManager, new IdentityAssetPathConverter());

        Asset asset = factory.createAsset(r);

        assertSame(asset.getResource(), r);
        assertEquals(asset.toClientURL(), expectedClientURL);
        assertEquals(asset.toString(), expectedClientURL);

        verify();
    }
View Full Code Here

TOP

Related Classes of net.feed_the_beast.launcher.json.assets.AssetIndex$Asset

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.