Package net.feed_the_beast.launcher.json.assets

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


        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        Asset library1 = mockAsset("mylib1.js");
        Asset library2 = mockAsset("mylib2.js");

        JavaScriptStack mystack = mockJavaScriptStack();

        expect(stackSource.getStackNames()).andReturn(Arrays.asList("mystack"));
        expect(stackSource.getStack("mystack")).andReturn(mystack).atLeastOnce();
View Full Code Here


        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        trainForNoStackNames(stackSource);

        Asset library1 = mockAsset("mylib1.js");
        Asset library2 = mockAsset("mylib2.js");

        linker.addScriptLink("mylib1.js");
        linker.addScriptLink("mylib2.js");

        replay();
View Full Code Here

    @Test
    public void import_stylesheet_as_asset()
    {
        DocumentLinker linker = mockDocumentLinker();
        Asset stylesheet = mockAsset("style.css");

        StylesheetLink link = new StylesheetLink("style.css");
        linker.addStylesheetLink(link);

        replay();
View Full Code Here

        return newMock(JavaScriptSupport.class);
    }

    protected final Asset mockAsset(String assetURL)
    {
        Asset asset = mockAsset();

        train_toClientURL(asset, assetURL);

        return asset;
    }
View Full Code Here

    @Override
    public Asset createAsset(Resource resource)
    {
        final URL url = resource.toURL();
        Asset asset = cache.get(url);
        if (asset == null)
        {
            asset = new UrlAsset(url.toExternalForm(), resource);
            cache.put(url, asset);
        }
View Full Code Here

                        // 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

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

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

            if (asset != null)
            {
                String assetURL = asset.toClientURL();

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

        if (providedChecksum.length() > 0 && !providedChecksum.equals(actualChecksum))
        {
           
            // TAP5-2185: Trying to find the wrongly-checksummed resource in the classpath and context,
            // so we can create an Asset with the correct checksum and redirect to it.
            Asset asset = null;
            if (resource != null)
            {
                asset = findAssetInsideWebapp(resource);
            }
            if (asset != null)
            {
                response.sendRedirect(asset.toClientURL());
                return true;
            }
            return false;
        }
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.