org.abstracthorizon.danube.http.util
Class ReadWriteFileConnectionHandler
java.lang.Object
org.abstracthorizon.danube.http.BaseReflectionHTTPConnectionHandler
org.abstracthorizon.danube.http.util.ReadOnlyFileConnectionHandler
org.abstracthorizon.danube.http.util.ReadWriteFileConnectionHandler
- All Implemented Interfaces:
- ConnectionHandler
public class ReadWriteFileConnectionHandler
- extends ReadOnlyFileConnectionHandler
Connection handler that handles static files (and directories)
- Author:
- Daniel Sendula
Methods inherited from class org.abstracthorizon.danube.http.util.ReadOnlyFileConnectionHandler |
encode, getBufferSize, getFileHandle, getFilePath, getFileTypeMap, getLengthAsString, handleDirectory, handleFile, methodGET, methodHEAD, obtainBuffer, releaseBuffer, setBufferSize, setFilePath, 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 |
ReadWriteFileConnectionHandler
public ReadWriteFileConnectionHandler()
- Constructor
methodDELETE
public void methodDELETE(HTTPConnection httpConnection)
methodPUT
public void methodPUT(HTTPConnection httpConnection)
- This method retruns list of files from give directory or returns a file,
using
FileTypeMap
to convert file extension to mime type
- Parameters:
httpConnection
- http connection
uploadFile
protected void uploadFile(File file,
HTTPConnection httpConnection)
- Uploads the file
- Parameters:
file
- filehttpConnection
- http connection
transferToFileChannel
protected void transferToFileChannel(FileChannel fileChannel,
ReadableByteChannel inputChannel,
long length)
throws IOException
- Transfer given channel to the file channel
- Parameters:
inputChannel
- file channelfileChannel
- output channellength
- length
- Throws:
IOException
- IO exception
Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.