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.internal.services.assets
Class StreamableResourceImpl

    java.lang.Object
      org.apache.tapestry5.internal.services.assets.StreamableResourceImpl

All Implemented Interfaces:
  StreamableResource

    public class StreamableResourceImpl

extends java.lang.Object
implements StreamableResource

Constructor Summary
`StreamableResourceImpl(java.lang.String description, java.lang.String contentType, CompressionStatus compression, long lastModified, BytestreamCache bytestreamCache)`

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.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### StreamableResourceImpl

    public StreamableResourceImpl(java.lang.String description,
                                  java.lang.String contentType,
                                  CompressionStatus compression,
                                  long lastModified,
                                  BytestreamCache bytestreamCache)

Method Detail

### getDescription

    public java.lang.String getDescription()

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

  Specified by:
    `getDescription` in interface `StreamableResource`

### getCompression

    public CompressionStatus getCompression()

  Description copied from interface: `StreamableResource`
  Indicates if the content is compressed, or compressable.

  Specified by:
    `getCompression` in interface `StreamableResource`

### getContentType

    public java.lang.String getContentType()

  Description copied from interface: `StreamableResource`
  Returns the MIME content type, e.g., "image/jpeg".

  Specified by:
    `getContentType` in interface `StreamableResource`

### getSize

    public int getSize()

  Description copied from interface: `StreamableResource`
  The size, in bytes, of the underlying bytestream.

  Specified by:
    `getSize` in interface `StreamableResource`

### getLastModified

    public long getLastModified()

  Description copied from interface: `StreamableResource`
  Returns the time the resource was last modified, with accuracy to one second (so as to match the HTTP request/response date headers.

  Specified by:
    `getLastModified` in interface `StreamableResource`

### streamTo

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

  Description copied from interface: `StreamableResource`
  Streams the resource's content to the provided stream. The caller is responsible for flushing or closing the output stream.

  Specified by:
    `streamTo` in interface `StreamableResource`
  Throws:
    `java.io.IOException`

### openStream

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

  Description copied from interface: `StreamableResource`
  Opens the content of the resource as an input stream; the caller is responsible for closing the stream after reading it.

  Specified by:
    `openStream` in interface `StreamableResource`
  Returns:
    stream of the contents of the resource
  Throws:
    `java.io.IOException`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

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.