Part of lp.services.librarian.interfaces.client View In Hierarchy
Known subclasses: lp.services.librarian.interfaces.client.ILibrarianClient
Method | addFile | Add a file to the librarian. |
Method | remoteAddFile | Add a file to the librarian using the remote protocol. |
Database insertions are done by the client, so access to the LibraryFileAlias and LibraryFileContent objects is available immediately. However, the newly uploaded file cannot be retrieved from the Librarian until the client transaction has been committed.
Returns the id of the newly added LibraryFileAlias
Parameters | name | Name to store the file as. |
size | Size of the file. | |
file | File-like object with the content in it. | |
expires | Expiry time of file, or None to keep until unreferenced. | |
Raises | UploadFailed | If the server rejects the upload for some reason |
As per addFile, except that the database insertions are done by the librarian. This means that the corresponding rows in the LibraryFileAlias and LibraryFileContent tables will not be available until the client transaction has been committed. However, the data is retrievable from the Librarian even if the client transaction rolls back.
This method is used to ensure files get placed into the Librarian even when the current transaction may be rolled back (eg. for storing exception information in the Librarian), or when the client does not have a database connection (eg. untrusted code).
Returns the URL of the newly added file.