org.apache.tapestry5.internal.services
Class StreamableResourceImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.services.StreamableResourceImpl
All Implemented Interfaces:
StreamableResource

public class StreamableResourceImpl
extends Object
implements StreamableResource


Constructor Summary
StreamableResourceImpl(URL url, long lastModified)
           
 
Method Summary
 String getContentType()
          Returns the content type available from the underlying URLConnection, which may be null.
 long getLastModified()
          Returns the time the underlying file was last modified.
 int getSize(boolean compress)
          Returns the size of the content
 InputStream getStream(boolean compress)
          Returns the raw input stream (wrapped in a BufferedInputStream, or the compressed bytestream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamableResourceImpl

public StreamableResourceImpl(URL url,
                              long lastModified)
Method Detail

getSize

public int getSize(boolean compress)
            throws IOException
Description copied from interface: StreamableResource
Returns the size of the content

Specified by:
getSize in interface StreamableResource
Parameters:
compress - if true, return size of compressed content
Returns:
size
Throws:
IOException

getStream

public InputStream getStream(boolean compress)
                      throws IOException
Description copied from interface: StreamableResource
Returns the raw input stream (wrapped in a BufferedInputStream, or the compressed bytestream.

Specified by:
getStream in interface StreamableResource
Parameters:
compress - if true, return compressed version
Returns:
stream of raw or compressed bytes
Throws:
IOException

getLastModified

public long getLastModified()
                     throws IOException
Description copied from interface: StreamableResource
Returns the time the underlying file was last modified.

Specified by:
getLastModified in interface StreamableResource
Throws:
IOException

getContentType

public String getContentType()
                      throws IOException
Description copied from interface: StreamableResource
Returns the content type available from the underlying URLConnection, which may be null.

Specified by:
getContentType in interface StreamableResource
Returns:
content type, or null
Throws:
IOException


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.