Package com.bazaarvoice.dropwizard.assets

Examples of com.bazaarvoice.dropwizard.assets.AssetServlet$Asset


        String coreScript = "corescript.js";

        DocumentLinker linker = mockDocumentLinker();
        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        Asset coreAsset = mockAsset(coreScript);
        ClientInfrastructure infrastructure = mockJavascriptStack(coreAsset);

        linker.addScriptLink(coreScript);
        linker.addScript("Tapestry.Foo(\"bar\");");
View Full Code Here


    {
        String coreScript = "corescript.js";
        DocumentLinker linker = mockDocumentLinker();
        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        Asset coreAsset = mockAsset(coreScript);

        ClientInfrastructure infrastructure = mockJavascriptStack(coreAsset);

        linker.addScriptLink(coreScript);
View Full Code Here

        return infrastructure;
    }

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

        train_toClientURL(asset, assetURL);

        return asset;
    }
View Full Code Here

    {
        String path = "${root}/foo/bar.pdf";
        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();

        train_expandSymbols(source, path, expanded);
View Full Code Here

    @Test
    public void add_stylesheet_link_by_asset()
    {
        String media = "print";
        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();

        train_toClientURL(asset, ASSET_URL);
        linker.addStylesheetLink(ASSET_URL, media);

        replay();
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

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

        Asset messages = assetSource.getAsset(null, "org/apache/tapestry5/tapestry-messages.js",
                                              threadLocale.getLocale());

        result.add(messages);

        return result;
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

TOP

Related Classes of com.bazaarvoice.dropwizard.assets.AssetServlet$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.