com.timeindexing.servlet
Class MP3StreamServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.timeindexing.servlet.SelectServlet
              extended by com.timeindexing.servlet.MP3StreamServlet
All Implemented Interfaces:
IndexPrimaryEventListener, java.io.Serializable, java.util.EventListener, javax.servlet.Servlet, javax.servlet.ServletConfig

public class MP3StreamServlet
extends SelectServlet

This servlet returns a response that causes the receiver to stream MP3 data.

The mime type of the reposnse is "audio/x-mpegurl".
The associate file name is "download.m3u".

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.timeindexing.servlet.SelectServlet
SelectServlet.WriterOutputStream
 
Constructor Summary
MP3StreamServlet()
           
 
Method Summary
 int doPlayBack(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, IndexProperties properties, int passedInStatus)
          Playback the data.
protected  java.lang.String encode(java.lang.String httpdata)
          Some URL encoding.
protected  java.lang.String fileNameGenerator(IndexProperties properties)
          This filename generator, takes the arguments and generates a useful filename.
protected  void setFilename(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, IndexProperties properties)
          Set the filename for downloads.
 
Methods inherited from class com.timeindexing.servlet.SelectServlet
allocateSelecter, closed, committed, created, doGet, empty, getContentType, init, isBrowser, isSecurityCodeOn, opened, postPlaybackError, prePlaybackError, setContentType, viewAdded, viewRemoved
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3StreamServlet

public MP3StreamServlet()
Method Detail

doPlayBack

public int doPlayBack(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      IndexProperties properties,
                      int passedInStatus)
               throws java.io.IOException
Description copied from class: SelectServlet
Playback the data.

Overrides:
doPlayBack in class SelectServlet
Returns:
the status of doing the playback
Throws:
java.io.IOException

setFilename

protected void setFilename(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           IndexProperties properties)
Set the filename for downloads.

Overrides:
setFilename in class SelectServlet

fileNameGenerator

protected java.lang.String fileNameGenerator(IndexProperties properties)
This filename generator, takes the arguments and generates a useful filename. Returns filename-0:10-to-1:23.

Overrides:
fileNameGenerator in class SelectServlet

encode

protected java.lang.String encode(java.lang.String httpdata)
Some URL encoding.



Timeindexing 2008