Package net.feed_the_beast.launcher.json.assets

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


                        // path was a bit too full of ../ sequences, in which case the expanded path is not valid and we adjust the
                        // error we write.

                        Resource metaResource = findLocalizedResource(null, metaPath, resources.getLocale());

                        Asset result = getComponentAsset(resources, expanded, metaResource);

                        if (result == null)
                        {
                            throw new RuntimeException(String.format("Unable to locate asset '%s' for component %s. It should be located at %s.",
                                    path, resources.getCompleteId(),
                                    metaPath));
                        }

                        // This is the best way to tell if the result is an asset for a Classpath resource.

                        Resource resultResource = result.getResource();

                        if (!resultResource.equals(metaResource))
                        {
                            if (firstWarning.getAndSet(false))
                            {
View Full Code Here


    {
        try
        {
            acquireReadLock();

            Asset result = TapestryInternalUtils.getAndDeref(cache, resource);

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

        {
            upgradeReadLockToWriteLock();

            // Check for competing thread beat us to it (not very likely!):

            Asset result = TapestryInternalUtils.getAndDeref(cache, resource);

            if (result != null)
            {
                return result;
            }
View Full Code Here

    {
        // There's some possibility this isn't quite right when it appears in a base class and a
        // sub-class gets instantiated, because relative path for the asset should be relative to the
        // base class, but will instead by relative to the subclass.

        Asset asset = source.getComponentAsset(container, expression);

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

                // considered a real change, since all such variations are valid.
                appendReplacement(matcher, output, url);
                continue;
            }

            Asset asset = assetSource.getAsset(baseResource, url, null);

            String assetURL = asset.toClientURL();

            String queryParameters = matcher.group(3);
            if (queryParameters != null)
            {
                assetURL += queryParameters;
View Full Code Here

    @Test
    public void relative_asset()
    {
        AssetFactory factory = mockAssetFactory();
        ThreadLocale threadLocale = mockThreadLocale();
        Asset asset = mockAsset();

        Resource expectedResource = baseResource.forFile("SimpleComponent_en_GB.properties");

        train_getRootResource(factory, rootResource);
View Full Code Here

    @Test
    public void get_classpath_asset()
    {
        AssetFactory factory = mockAssetFactory();
        ThreadLocale threadLocale = mockThreadLocale();
        Asset asset = mockAsset();

        Resource expectedResource = baseResource.forFile("SimpleComponent_en_GB.properties");

        train_getRootResource(factory, rootResource);
View Full Code Here

    @Test
    public void get_expanded_asset()
    {
        AssetFactory factory = mockAssetFactory();
        Asset asset = mockAsset();
        SymbolSource symbolSource = mockSymbolSource();

        Resource expectedResource = baseResource.forFile("SimpleComponent.properties");

        train_getRootResource(factory, rootResource);
View Full Code Here

    @Test
    public void get_classpath_asset_for_unspecified_locale()
    {
        AssetFactory factory = mockAssetFactory();
        ThreadLocale threadLocale = mockThreadLocale();
        Asset asset = mockAsset();
        Locale locale = Locale.UK;

        Resource expectedResource = baseResource.forFile("SimpleComponent_en_GB.properties");

        train_getRootResource(factory, rootResource);
View Full Code Here

    @Test
    public void absolute_asset_with_known_prefix()
    {
        AssetFactory factory = mockAssetFactory();
        ThreadLocale threadLocale = mockThreadLocale();
        Asset asset = mockAsset();

        Resource expectedResource = rootResource
                .forFile("org/apache/tapestry5/internal/services/SimpleComponent_en_GB.properties");

        train_getRootResource(factory, rootResource);
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.