@Path("streams/{index}/{filename}")
    public StreamResource getStream(@PathParam("index") final int streamIndex,
            @QueryParam("type") @DefaultValue(DEFAULT_MEDIA_TYPE) String mediaType,
            @PathParam("filename") String filename)
            throws GuacamoleException {

        return new StreamResource(tunnel, streamIndex, mediaType);

    }
Intercepts and returns the entire contents of a specific stream.

@param streamIndex
    The index of the stream to intercept.

@param mediaType
    The media type (mimetype) of the data within the stream.

@param filename
    The filename to use for the sake of identifying the data returned.

@return
    A response through which the entire contents of the intercepted
    stream will be sent.

@throws GuacamoleException
    If the session associated with the given auth token cannot be
    retrieved, or if no such tunnel exists.
guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java