Examples of StreamableResourceImpl


Examples of org.apache.tapestry5.internal.services.assets.StreamableResourceImpl

        writer.close();

        // The content is minimized, but can still be (GZip) compressed.

        StreamableResource output = new StreamableResourceImpl("minimized " + input.getDescription(),
                input.getContentType(), CompressionStatus.COMPRESSABLE,
                input.getLastModified(), new BytestreamCache(bos));

        if (logger.isInfoEnabled())
        {
            long elapsedNanos = System.nanoTime() - startNanos;

            int inputSize = input.getSize();
            int outputSize = output.getSize();

            double elapsedMillis = ((double) elapsedNanos) * NANOS_TO_MILLIS;
            // e.g., reducing 100 bytes to 25 would be a (100-25)/100 reduction, or 75%
            double reduction = 100d * ((double) (inputSize - outputSize)) / ((double) inputSize);

View Full Code Here

Examples of org.apache.tapestry5.internal.services.assets.StreamableResourceImpl

        writer.close();

        // The content is minimized, but can still be (GZip) compressed.

        StreamableResource output = new StreamableResourceImpl("minimized " + input.getDescription(),
                input.getContentType(), CompressionStatus.COMPRESSABLE,
                input.getLastModified(), new BytestreamCache(bos));

        long elapsedNanos = System.nanoTime() - startNanos;

        if (logger.isDebugEnabled())
        {
            double elapsedMillis = ((double) elapsedNanos) * NANOS_TO_MILLIS;

            logger.debug(String.format("Minimized %s (%,d input bytes of %s to %,d output bytes in %.2f ms)",
                    input.getDescription(), input.getSize(), resourceType, output.getSize(), elapsedMillis));
        }

        return output;
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.services.assets.StreamableResourceImpl

            }
        });

        // The content is minimized, but can still be (GZip) compressed.

        StreamableResource output = new StreamableResourceImpl("minimized " + input.getDescription(),
                input.getContentType(), CompressionStatus.COMPRESSABLE,
                input.getLastModified(), new BytestreamCache(bos), checksumGenerator, input.getResponseCustomizer());

        if (logger.isInfoEnabled())
        {
            long elapsedNanos = System.nanoTime() - startNanos;

            int inputSize = input.getSize();
            int outputSize = output.getSize();

            double elapsedMillis = ((double) elapsedNanos) * NANOS_TO_MILLIS;
            // e.g., reducing 100 bytes to 25 would be a (100-25)/100 reduction, or 75%
            double reduction = 100d * ((double) (inputSize - outputSize)) / ((double) inputSize);

View Full Code Here

Examples of org.apache.tapestry5.internal.services.assets.StreamableResourceImpl

        inputStream.close();
        writer.close();

        // The content is minimized, but can still be (GZip) compressed.

        StreamableResource output = new StreamableResourceImpl(input.getContentType(), CompressionStatus.COMPRESSABLE,
                input.getLastModified(), new BytestreamCache(bos));

        long elapsedNanos = System.nanoTime() - startNanos;

        if (logger.isDebugEnabled())
        {
            double elapsedMillis = ((double) elapsedNanos) * NANOS_TO_MILLIS;

            logger.debug(String.format("Minimized %,d input bytes of %s to %,d output bytes in %.2f ms",
                    input.getSize(), resourceType, output.getSize(), elapsedMillis));
        }

        return output;
    }
View Full Code Here

Examples of org.apache.tapestry5.internal.services.assets.StreamableResourceImpl

            }
        });

        // The content is minimized, but can still be (GZip) compressed.

        StreamableResource output = new StreamableResourceImpl("minimized " + input.getDescription(),
                input.getContentType(), CompressionStatus.COMPRESSABLE,
                input.getLastModified(), new BytestreamCache(bos), checksumGenerator);

        if (logger.isInfoEnabled())
        {
            long elapsedNanos = System.nanoTime() - startNanos;

            int inputSize = input.getSize();
            int outputSize = output.getSize();

            double elapsedMillis = ((double) elapsedNanos) * NANOS_TO_MILLIS;
            // e.g., reducing 100 bytes to 25 would be a (100-25)/100 reduction, or 75%
            double reduction = 100d * ((double) (inputSize - outputSize)) / ((double) inputSize);

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.