Package flumotion :: Package component :: Package misc :: Package httpserver :: Module httpfile :: Class File
[hide private]

Class File

source code

twisted.web.resource.Resource --+
                                |
      extern.log.log.Loggable --+
                                |
                               File

this file is inspired by/adapted from twisted.web.static

Instance Methods [hide private]
 
__init__(self, path, httpauth, mimeToResource=None, rateController=None, requestModifiers=None, metadataProvider=None) source code
 
getChild(self, path, request) source code
 
render(self, request)
The request gets rendered by asking the httpauth object for authentication, which returns a deferred.
source code
 
_authenticationFailed(self, failure, request) source code
 
_requestAuthenticated(self, result, request) source code
 
_terminateRequest(self, body, request) source code
 
_renderRequest(self, _, request) source code
 
_fileOpenFailure(self, failure, request) source code
 
_gotProvider(self, provider, request) source code
 
_startRequest(self, request, header, provider, first, last) source code
 
_configureTransfer(self, metadata, request, header, provider, first, last) source code
 
do_prepareBody(self, request, provider, first, last)
I am called before the body of the response gets written, and after generic header setting has been done.
source code

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]
  logCategory = "httpserver"
Implementors can provide a category to log their messages under.
  defaultType = "application/octet-stream"
  childNotFound = errorpage.NoResource("File not found.")
  forbiddenerrorpage = errorpage.ForbiddenResource("Access forbi...
  badRequest = BadRequest()
  internalServerError = InternalServerError()
  serviceUnavailable = ServiceUnavailableError()
Method Details [hide private]

render(self, request)

source code 

The request gets rendered by asking the httpauth object for authentication, which returns a deferred. This deferred will callback when the request gets authenticated.

do_prepareBody(self, request, provider, first, last)

source code 

I am called before the body of the response gets written, and after generic header setting has been done.

I set Content-Length.

Override me to send additional headers, or to prefix the body with data headers.

I can return a Deferred, that should fire with a string header. That header will be written to the request.


Class Variable Details [hide private]

forbiddenerrorpage

Value:
errorpage.ForbiddenResource("Access forbidden")