Part of twisted.web2.static View Source View In Hierarchy
Implements interfaces: twisted.web2.iweb.IResource
Alternatively, you can give a directory path to the constructor. In this case the resource will represent that directory, and its children will be files underneath that directory. This provides access to an entire filesystem tree with a single Resource.
If you map the URL 'http://server/FILE' to a resource created as File('/tmp'), then http://server/FILE/ will return an HTML-formatted listing of the /tmp/ directory, and http://server/FILE/foo/bar.html will return the contents of /tmp/foo/bar.html .
Method | __init__ | Create a file with the given path. |
Method | exists | |
Method | etag | |
Method | lastModified | |
Method | creationDate | |
Method | contentLength | |
Method | contentType | |
Method | contentEncoding | |
Method | displayName | |
Method | ignoreExt | Ignore the given extension. |
Method | directoryListing | Undocumented |
Method | putChild | Register a child with the given name with this resource. |
Method | getChild | Look up a child resource. |
Method | listChildren | |
Method | locateChild | See IResource .locateChild . |
Method | renderHTTP | See resource.RenderMixIn.renderHTTP . |
Method | render | You know what you doing. |
Method | createSimilarFile | Undocumented |
Method | _getContentTypes | Undocumented |
Method | _initTypeAndEncoding | Undocumented |
Inherited from StaticRenderMixin:
Method | checkPreconditions | Checks all preconditions imposed by this resource upon a request made |
Inherited from RenderMixin (via StaticRenderMixin):
Method | allowedMethods | |
Method | http_OPTIONS | Respond to a OPTIONS request. |
Method | http_TRACE | Respond to a TRACE request. |
Method | http_HEAD | Respond to a HEAD request. |
Method | http_GET | Respond to a GET request. |
Returns | True if the resource exists on the server, False otherwise. |
Returns | The current etag for the resource if available, None otherwise. |
Returns | The last modified time of the resource if available, None otherwise. |
Returns | The creation date of the resource if available, None otherwise. |
Returns | The size in bytes of the resource if available, None otherwise. |
Returns | The encoding of the resource if available, None otherwise. |
Returns | The display name of the resource if available, None otherwise. |
Parameters | name | the name of the child (a URI path segment) |
child | the child to register |
Returns | the child of this resource with the given name. |
Returns | a sequence of the names of all known children of this resource. |
resource.RenderMixIn.renderHTTP
.
This implementation automatically sets some headers on the response
based on data available from MetaDataMixin
methods.