org.abstracthorizon.danube.http.spring.util
Class FileConnectionHandler

java.lang.Object
  extended by org.abstracthorizon.danube.http.BaseReflectionHTTPConnectionHandler
      extended by org.abstracthorizon.danube.http.util.ReadOnlyFileConnectionHandler
          extended by org.abstracthorizon.danube.http.spring.util.FileConnectionHandler
All Implemented Interfaces:
ConnectionHandler, ApplicationContextAware

public class FileConnectionHandler
extends ReadOnlyFileConnectionHandler
implements ApplicationContextAware

Connection handler that handles static files (and directories)

Author:
Daniel Sendula

Field Summary
 
Fields inherited from class org.abstracthorizon.danube.http.util.ReadOnlyFileConnectionHandler
bufferSize, dateFormat, DEFAULT_BUFFER_SIZE, filePath, fileTypeMap, GIGABYTE, KILOBYTE, MEGABYTE, TERABYTE
 
Fields inherited from class org.abstracthorizon.danube.http.BaseReflectionHTTPConnectionHandler
cachedMethods, errorResponse, noDefaultHead, noDefaultTrace
 
Constructor Summary
FileConnectionHandler()
          Constructor
 
Method Summary
 File getFilePath()
          Sets path where files are stored
 void setApplicationContext(ApplicationContext context)
          This method sets file path to file path obtained from application context (through ResourceLoader.getResource(String))
 void setFilePath(File filePath)
          Sets path where files are stored
 
Methods inherited from class org.abstracthorizon.danube.http.util.ReadOnlyFileConnectionHandler
encode, getBufferSize, getFileHandle, getFileTypeMap, getLengthAsString, handleDirectory, handleFile, methodGET, methodHEAD, obtainBuffer, releaseBuffer, setBufferSize, setFileTypeMap, transferFromFileChannel, transferStreams, updateHeadersForFile
 
Methods inherited from class org.abstracthorizon.danube.http.BaseReflectionHTTPConnectionHandler
cacheMethods, getErrorResponse, getNoDefaultHead, getNoDefaultTrace, handleConnection, invokeMethod, methodOPTIONS, methodTRACE, returnError, returnSimpleContent, setErrorResponse, setNoDefaultHead, setNoDefaultTrace, updateDefaultHeadMethod, updateDefaultTraceMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileConnectionHandler

public FileConnectionHandler()
Constructor

Method Detail

setFilePath

public void setFilePath(File filePath)
Sets path where files are stored

Overrides:
setFilePath in class ReadOnlyFileConnectionHandler
Parameters:
filePath - file path

getFilePath

public File getFilePath()
Sets path where files are stored

Overrides:
getFilePath in class ReadOnlyFileConnectionHandler
Returns:
file path

setApplicationContext

public void setApplicationContext(ApplicationContext context)
                           throws BeansException,
                                  RuntimeIOException
This method sets file path to file path obtained from application context (through ResourceLoader.getResource(String))

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
context - application context
Throws:
BeansException
RuntimeIOException


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.