edu.whoi.ursa.argoDatabase.servletUtil.serve
Class ServeFile

java.lang.Object
  extended by edu.whoi.ursa.argoDatabase.servletUtil.serve.ServeFile
Direct Known Subclasses:
RgDot._RgDot

public abstract class ServeFile
extends java.lang.Object


Field Summary
private  javax.servlet.http.HttpSession httpSession
           
private  java.util.Map<java.lang.String,java.lang.String[]> parameterMap
           
 
Constructor Summary
ServeFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
protected abstract  java.lang.String contentType()
           
protected abstract  java.lang.String fileName()
           
protected abstract  void generateContent(java.io.OutputStream outputStream)
           
 java.lang.Object getAttribute(java.lang.String key)
           
 javax.servlet.http.HttpSession getHttpSession()
           
protected  java.lang.String getParameter(java.lang.String key)
          Retrieve parameter from HttpServletRequest as String.
protected  java.lang.String[] getParameterAsArray(java.lang.String key)
          Retrieve parameter from HttpServletRequest as Array of Strings.
protected  java.lang.Integer[] getParameterAsArrayOfIntegers(java.lang.String key)
          Retrieve parameter from HttpServletRequest as Integer.
protected  java.util.Calendar getParameterAsCalendar(java.lang.String key)
          Retrieve parameter from HttpServletRequest as Float.
protected  java.lang.Float getParameterAsFloat(java.lang.String key)
          Retrieve parameter from HttpServletRequest as Float.
protected  java.lang.Integer getParameterAsInteger(java.lang.String key)
          Retrieve parameter from HttpServletRequest as Integer.
protected  java.lang.Long getParameterAsLong(java.lang.String key)
          Retrieve parameter from HttpServletRequest as Long.
 java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
           
protected  java.lang.Boolean isSet(java.lang.String key)
          Is parameter set?
private  void respond(javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameterMap

private java.util.Map<java.lang.String,java.lang.String[]> parameterMap

httpSession

private javax.servlet.http.HttpSession httpSession
Constructor Detail

ServeFile

public ServeFile(javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response)
Method Detail

respond

private void respond(javax.servlet.http.HttpServletResponse response)

contentType

protected abstract java.lang.String contentType()

fileName

protected abstract java.lang.String fileName()

generateContent

protected abstract void generateContent(java.io.OutputStream outputStream)

getParameterMap

public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
Returns:
the parameterMap

getHttpSession

public javax.servlet.http.HttpSession getHttpSession()
Returns:
the httpSession

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Parameters:
key -
Returns:

getParameter

protected java.lang.String getParameter(java.lang.String key)
Retrieve parameter from HttpServletRequest as String.

Parameters:
key -
Returns:
parameter as String. null if parameter is not set

isSet

protected java.lang.Boolean isSet(java.lang.String key)
Is parameter set?

Parameters:
key -
Returns:
true if parameter is set, false otherwise

getParameterAsArray

protected java.lang.String[] getParameterAsArray(java.lang.String key)
Retrieve parameter from HttpServletRequest as Array of Strings.

Parameters:
key -
Returns:
parameter as Array of Strings. null if parameter is not set

getParameterAsArrayOfIntegers

protected java.lang.Integer[] getParameterAsArrayOfIntegers(java.lang.String key)
Retrieve parameter from HttpServletRequest as Integer.

Parameters:
key -
Returns:
parameter as Float. null if parameter is not set or if not valid Integer value

getParameterAsCalendar

protected java.util.Calendar getParameterAsCalendar(java.lang.String key)
Retrieve parameter from HttpServletRequest as Float.

Parameters:
key -
Returns:
parameter as Integer. null if parameter is not set or if not valid Float value

getParameterAsFloat

protected java.lang.Float getParameterAsFloat(java.lang.String key)
Retrieve parameter from HttpServletRequest as Float.

Parameters:
key -
Returns:
parameter as Integer. null if parameter is not set or if not valid Float value

getParameterAsInteger

protected java.lang.Integer getParameterAsInteger(java.lang.String key)
Retrieve parameter from HttpServletRequest as Integer.

Parameters:
key -
Returns:
parameter as Float. null if parameter is not set or if not valid Integer value

getParameterAsLong

protected java.lang.Long getParameterAsLong(java.lang.String key)
Retrieve parameter from HttpServletRequest as Long.

Parameters:
key -
Returns:
parameter as Long. null if parameter is not set or if not valid Long value