org.apache.tapestry5.internal.services
Interface ResourceStreamer

All Known Implementing Classes:
ResourceStreamerImpl

@UsesMappedConfiguration(value=java.lang.String.class)
public interface ResourceStreamer

Responsible for streaming the contents of a resource to the client. The Resource to stream is almost always a ClasspathResource.

The service's configuration is used to map file extensions to content types. Note: this only works for simple extensions (i.e., "jpg") not for complex extensions (i.e., "tar.gz").

Since:
5.1.0.0

Method Summary
 String getContentType(Resource resource)
          Analyzes the resource to determine what its content type is, possibly using the service's configuration.
 void streamResource(Resource resource)
          Streams the content of the resource to the client.
 

Method Detail

streamResource

void streamResource(Resource resource)
                    throws IOException
Streams the content of the resource to the client.

Throws:
IOException

getContentType

String getContentType(Resource resource)
                      throws IOException
Analyzes the resource to determine what its content type is, possibly using the service's configuration.

Parameters:
resource - to analyze
Returns:
content type
Throws:
IOException


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