es.mcu.yingo.controladores
Class ControladorBajarFichero

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by es.mcu.yingo.controladores.ControladorBajarFichero
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.servlet.mvc.Controller

public class ControladorBajarFichero
extends org.springframework.web.servlet.mvc.AbstractController

Realiza las operaciones necesarias para descargar los ficheros
Este controlador recibirá un objeto UtilFichero que apuntará al servidor de ficheros de donde se recuperarán los archivos

Author:
carlos.garcia.h

Field Summary
private  UtilFichero utilFichero
          Utilidad que permite acceder al fichero
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
ControladorBajarFichero()
          Constructor por defecto
 
Method Summary
private  void escribirCabeceras(java.lang.String mime, java.lang.String nombreFichero, javax.servlet.http.HttpServletResponse response)
          Escribe las cabeceras en el response para descarga.
protected  void escribirFichero(java.lang.String nombreFichero, javax.servlet.http.HttpServletResponse response)
          Escribe el fichero en el outputstream del response
 UtilFichero getUtilFichero()
          Utilidad que permite acceder al fichero
protected  org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Recupera el fichero que se indique y lo vuelca en el response
 void setUtilFichero(UtilFichero utilFichero)
          Utilidad que permite acceder al fichero
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

utilFichero

private UtilFichero utilFichero
Utilidad que permite acceder al fichero

Constructor Detail

ControladorBajarFichero

public ControladorBajarFichero()
Constructor por defecto

Method Detail

handleRequestInternal

protected org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request,
                                                                             javax.servlet.http.HttpServletResponse response)
                                                                      throws java.lang.Exception
Recupera el fichero que se indique y lo vuelca en el response

Specified by:
handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
Parameters:
request -
response -
command -
errors -
Throws:
java.lang.Exception

escribirFichero

protected void escribirFichero(java.lang.String nombreFichero,
                               javax.servlet.http.HttpServletResponse response)
                        throws FicheroYingoException,
                               java.io.IOException
Escribe el fichero en el outputstream del response

Parameters:
nombreFichero -
response -
Throws:
FicheroPcrtException
java.io.IOException
FicheroYingoException

escribirCabeceras

private void escribirCabeceras(java.lang.String mime,
                               java.lang.String nombreFichero,
                               javax.servlet.http.HttpServletResponse response)
Escribe las cabeceras en el response para descarga. El tipo mime y el nombre del fichero

Parameters:
mime -
nombreFichero -
response -

getUtilFichero

public UtilFichero getUtilFichero()
Utilidad que permite acceder al fichero

Returns:
the utilFichero

setUtilFichero

public void setUtilFichero(UtilFichero utilFichero)
Utilidad que permite acceder al fichero

Parameters:
utilFichero - the utilFichero to set