Part of twisted.web2.dav View Source
WebDAV file operations
This API is considered private to static.py and is therefore subject to change.Function | delete | Perform a DELETE operation on the given URI, which is backed by the given |
Function | copy | Perform a COPY from the given source and destination filepaths. |
Function | move | Perform a MOVE from the given source and destination filepaths. |
Function | put | Perform a PUT of the given data stream into the given filepath. |
Function | mkcollection | Perform a MKCOL on the given filepath. |
Function | rmdir | Removes the directory with the given name, as well as its contents. |
Function | checkResponse | Undocumented |
Parameters | filepath | the FilePath to
delete.
|
depth | the recursion Depth for the DELETE operation, which must be "infinity". | |
Returns | a deferred response with a status code of
responsecode.NO_CONTENT if the DELETE operation
succeeds.
| |
Raises | HTTPError | (containing a response with a status code of
responsecode.BAD_REQUEST ) if depth is not
"infinity".
|
HTTPError | (containing an appropriate response) if the delete operation fails. If
filepath is a directory, the response will be a MultiStatusResponse .
|
copy
(as in
COPYMOVE.prepareForCopy
).
Parameters | source_filepath | a FilePath
for the file to copy from.
|
destination_filepath | a FilePath
for the file to copy to.
| |
destination_uri | the URI of the destination resource. | |
depth | the recursion Depth for the COPY operation, which must be one of "0", "1", or "infinity". | |
Returns | a deferred response with a status code of
responsecode.CREATED if the destination already exists, or
responsecode.NO_CONTENT if the destination was created by
the COPY operation.
| |
Raises | HTTPError | (containing a response with a status code of
responsecode.BAD_REQUEST ) if depth is not
"0", "1" or "infinity".
|
HTTPError | (containing an appropriate response) if the operation fails. If
source_filepath is a directory, the response will be a MultiStatusResponse .
|
copy
(as in
COPYMOVE.prepareForCopy
). Following the DELETE, this will
attempt an atomic filesystem move. If that fails, a COPY operation
followed by a DELETE on the source will be attempted instead.
Parameters | source_filepath | a FilePath
for the file to copy from.
|
destination_filepath | a FilePath
for the file to copy to.
| |
destination_uri | the URI of the destination resource. | |
depth | the recursion Depth for the MOVE operation, which must be "infinity". | |
Returns | a deferred response with a status code of
responsecode.CREATED if the destination already exists, or
responsecode.NO_CONTENT if the destination was created by
the MOVE operation.
| |
Raises | HTTPError | (containing a response with a status code of
responsecode.BAD_REQUEST ) if depth is not
"infinity".
|
HTTPError | (containing an appropriate response) if the operation fails. If
source_filepath is a directory, the response will be a MultiStatusResponse .
|
Parameters | stream | the stream to write to the destination. |
filepath | the FilePath of
the destination file.
| |
uri | the URI of the destination resource. If the destination exists, if
uri is not None , perform a DELETE operation on
the destination, but if uri is None , delete the
destination directly. Note that whether a put deletes the
destination directly vs. performing a DELETE on the destination affects
the response returned in the event of an error during deletion.
Specifically, DELETE on collections must return a MultiStatusResponse
under certain circumstances, whereas PUT isn't required to do so.
Therefore, if the caller expects DELETE semantics, it must provide a
valid uri .
| |
Returns | a deferred response with a status code of
responsecode.CREATED if the destination already exists, or
responsecode.NO_CONTENT if the destination was created by
the PUT operation.
| |
Raises | HTTPError | (containing an appropriate response) if the operation fails. |
Parameters | filepath | the FilePath of
the collection resource to create.
|
Returns | a deferred response with a status code of
responsecode.CREATED if the destination already exists, or
responsecode.NO_CONTENT if the destination was created by
the MKCOL operation.
| |
Raises | HTTPError | (containing an appropriate response) if the operation fails. |
Parameters | dirname | the path to the directory to remove. |