Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.services.assets
Interface StreamableResource

All Known Implementing Classes:
  StreamableResourceImpl

    public interface StreamableResource

An object, derived from a `Resource`, that can be streamed (ultimately, to a client web browser).

Since:
  5.3

Method Summary
`CompressionStatus` | `getCompression()` Indicates if the content is compressed, or compressable.
`java.lang.String` | `getContentType()` Returns the MIME content type, e.g., "image/jpeg".
`java.lang.String` | `getDescription()` Describes the underlying `Resource` (or resources} for this streamble resource; expressly used as part of the object's `toString()`.
`long` | `getLastModified()` Returns the time the resource was last modified, with accuracy to one second (so as to match the HTTP request/response date headers.
`int` | `getSize()` The size, in bytes, of the underlying bytestream.
`java.io.InputStream` | `openStream()` Opens the content of the resource as an input stream; the caller is responsible for closing the stream after reading it.
`void` | `streamTo(java.io.OutputStream os)` Streams the resource's content to the provided stream.

Method Detail

### getDescription

    java.lang.String getDescription()

  Describes the underlying `Resource` (or resources} for this streamble resource; expressly used as part of the object's `toString()`.

### getCompression

    CompressionStatus getCompression()

  Indicates if the content is compressed, or compressable.

### getContentType

    java.lang.String getContentType()

  Returns the MIME content type, e.g., "image/jpeg".

### getSize

    int getSize()

  The size, in bytes, of the underlying bytestream.

### streamTo

    void streamTo(java.io.OutputStream os)
                  throws java.io.IOException

  Streams the resource's content to the provided stream. The caller is responsible for flushing or closing the output stream.

  Throws:
    `java.io.IOException`

### openStream

    java.io.InputStream openStream()
                                   throws java.io.IOException

  Opens the content of the resource as an input stream; the caller is responsible for closing the stream after reading it.

  Returns:
    stream of the contents of the resource
  Throws:
    `java.io.IOException`

### getLastModified

    long getLastModified()

  Returns the time the resource was last modified, with accuracy to one second (so as to match the HTTP request/response date headers.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.