| org.sakaiproject.content.api.DavManager
DavManager | public interface DavManager (Code) | | |
Field Summary | |
final public static Integer | STATUS_CONFLICT Status code (409) indicating a resource cannot be created at the destination until one or more intermediate collections have been created. | final public static Integer | STATUS_CREATED Status code (201) indicating the request succeeded and created a new resource on the server. | final public static Integer | STATUS_FORBIDDEN Status code (403) indicating the server understood the request but refused to fulfill it. | final public static Integer | STATUS_METHOD_NOT_ALLOWED Status code (409) indicating requested action cannot be executed on an existing resource. | final public static Integer | STATUS_NO_CONTENT | final public static Integer | STATUS_UNAUTHORIZED Status code (401) indicating that the request requires HTTP authentication. |
Method Summary | |
public boolean | copy(String oldId, String newId, boolean overwrite, boolean recursive) Copies a resource or collection along with all attributes and properties. | public boolean | createCollection(String newId) Make a new collection. | public boolean | createResource(String newId, InputStream content, String contentType) Create the resource or update it if it exists.
if newid exists and is resource, update its contents, retaining properities;
however delete followed by create is OK as long as it preserves the old
properties.
If newid did not exist, use specified content type, if any. | public boolean | delete(String entityId) Delete a collection or resource. | public String | getContentType(String entityId) | public ResourceProperties | getProperties(String entityId) | public String | getProperty(String entityId, String propertyName) | public boolean | rename(String oldId, String newId, boolean overwrite) Moves a resource or collection along with all attributes and properties.
No properties are taken from any existing entity.
If the parameter overwrite is true, delete existing entities before
the move; otherwise fail if the new entity exists.
If the parameter oldId identifies a collection, move the entire hierarchy
of collections and resources rooted at oldId. | public String | setContentType(String entityId, String contentType) | public void | setProperties(String entityId, ResourceProperties properties) | public void | setProperty(String entityId, String propertyName, String propertyValue) | public OutputStream | streamContent(String entityId) |
STATUS_CONFLICT | final public static Integer STATUS_CONFLICT(Code) | | Status code (409) indicating a resource cannot be created at the destination until one or more intermediate collections have been created.
|
STATUS_CREATED | final public static Integer STATUS_CREATED(Code) | | Status code (201) indicating the request succeeded and created a new resource on the server.
|
STATUS_FORBIDDEN | final public static Integer STATUS_FORBIDDEN(Code) | | Status code (403) indicating the server understood the request but refused to fulfill it.
|
STATUS_METHOD_NOT_ALLOWED | final public static Integer STATUS_METHOD_NOT_ALLOWED(Code) | | Status code (409) indicating requested action cannot be executed on an existing resource.
|
STATUS_NO_CONTENT | final public static Integer STATUS_NO_CONTENT(Code) | | Status reporting an operation succeeded without creation of a new resource
|
STATUS_UNAUTHORIZED | final public static Integer STATUS_UNAUTHORIZED(Code) | | Status code (401) indicating that the request requires HTTP authentication.
|
copy | public boolean copy(String oldId, String newId, boolean overwrite, boolean recursive) throws PermissionException, InconsistentException, IdLengthException, InUseException, ServerOverloadException(Code) | | Copies a resource or collection along with all attributes and properties.
If the parameter overwrite is true, delete existing entity (or entities).
Otherwise update them. For collections, preexisting items from newId that
do not have corresponding items in oldId will remain.
If the parameter oldId identifies a collection and the parameter recursive
is true, copy the entire hierarchy of collections and resources rooted at
oldId. If the parameter oldId identifies a collection and the parameter
recursive is false, copy only the entity oldId. The copy succeeds unless
one of these errors occurs:
- no entity exists with the identifier oldId
- the user does not have permission to access the entity oldId
- the user does not have permission to create the entity newId
- the entity newId exists, and the user does not have permission to modify/delete oldId
- the entity newId exists, and the entity newId (or one of its members) is in use by another user
- overwrite is false and one of newId, oldId is a resource and the other a collection
- the containing collection for newId does not exist
- newId is too long to be used as a resource-id or collection-id
- the server is configured to write the resource body to the filesystem and an attempt to save the resource body fails
- the source and destination objects are the same
- writing the new resource puts the user over quota
If overwrite is set, the nature of any existing destination does not matter. It will be deleted.
Return: true if a new collection or resource was created, i.e. newId did not exist previously
Parameters: oldId - Parameters: newId - Parameters: overwrite - Parameters: recursive - true if a new collection or resource was created, i.e. newId did not exist previously throws: PermissionException - if the user does not have permission to access the old entity, delete the existing entity or create the new entity. throws: IdUnusedException - if oldIdd does not exist. throws: InconsistentException - if the containing collection (for newId) does not exist. throws: TypeException - if overwrite is false, and newId and oldId do not identify the same kind of entities (must both be identifiers for collections OR must bothbe identifiers for collections) throws: IdLengthException - if the newId is too long. throws: InUseException - if the entity specified by oldId is currently in use by another user or, if overwrite is true, the entity identified by newId exists and is in use by another user. throws: ServerOverloadException - if the server is configured to write the resource body to the filesystem and an attempt to save the resource body fails. throws: OverQuotaException - if writing the new resource puts the user over quota |
createCollection | public boolean createCollection(String newId) throws PermissionException, IdUsedException, InconsistentException, IdLengthException, IdInvalidException(Code) | | Make a new collection.
The new collection is empty.
The operation succeeds unless one of the following occurs:
- the user does not have permission to create the entity newId
- an entity newId exists
- newId is too long to be used as a resource-id or collection-id
- the server is configured to write the resource body to the filesystem and an attempt to save the resource body fails
- writing the new collection puts the user over quota
If successful, always returns true, because a new collection is always created
Parameters: newId - true if a new collection is created (which is always true unless an exception is thrown). throws: PermissionException - if the user does not have permission to add this entity. throws: IdUsedException - if the id is already in use. throws: InconsistentException - if the containing collection does not exist. throws: IdLengthException - if the newId is too long. throws: IdInvalidException - if the resource id is invalid. throws: ServerOverloadException - if the server is configured to write the collection to thefilesystem and it fails throws: OverQuotaException - if writing the new collection puts the user over quota |
createResource | public boolean createResource(String newId, InputStream content, String contentType) throws PermissionException, TypeException, InconsistentException, IdLengthException, InUseException, OverQuotaException, ServerOverloadException(Code) | | Create the resource or update it if it exists.
if newid exists and is resource, update its contents, retaining properities;
however delete followed by create is OK as long as it preserves the old
properties.
If newid did not exist, use specified content type, if any.
If contenttype is null, look at the extension. If no extension or unknown, use text/plain
The operation succeeds unless one of the following is true:
- newid exists and is a collection
- user does not have permission to create or write the new object
- the containing collection does not exist
- newId is too long to be used as a resource-id or collection-id
- the server is configured to write the resource body to the filesystem and an attempt to save the resource body fails
- writing the new resource puts the user over quota
Returns true if a new resource is created, i.e. if newId did not exist
Parameters: newId - Parameters: content - Parameters: contenttype - throws: PermissionException - if the user does not have permission to create or write to this entity. throws: TypeException - if the id is already in use and identifies a collection. TODO: Is this the right exception in that case?[I don't care what exception you use, as long as it is documented.] throws: InconsistentException - if the containing collection does not exist. throws: IdLengthException - if the newId is too long. throws: InUseException - if the entity exists and is currently in use by another user. throws: OverQuotaException - if the entity cannot be added without exceeding the quota. throws: ServerOverloadException - if the server is configured to write the resource body to the filesystem and an attempt to save the resource body fails. throws: OverQuotaException - if writing the new collection puts the user over quota |
delete | public boolean delete(String entityId) throws PermissionException, IdUnusedException, InUseException(Code) | | Delete a collection or resource. If entity is a non-empty collection,
remove it and everything it contains.
Fails if
- no entity exists with the identifier entityId
- the user does not have permission to delete the entity
- the server is configured to write the resource body to the filesystem and an attempt to delete it fails
Always returns false.
Parameters: entityId - throws: PermissionException - if the user does not have permission to delete this entity. throws: InUseException - if the entity (or one of its members) is currently in useby another user. throws: IdUnusedException - if entityId does not exist. throws: ServerOverloadException - if the server is configured to write the resource body to the filesystem and an attempt to delete it fails. |
rename | public boolean rename(String oldId, String newId, boolean overwrite) throws PermissionException, IdUsedException, InconsistentException, IdLengthException, InUseException, TypeException, ServerOverloadException(Code) | | Moves a resource or collection along with all attributes and properties.
No properties are taken from any existing entity.
If the parameter overwrite is true, delete existing entities before
the move; otherwise fail if the new entity exists.
If the parameter oldId identifies a collection, move the entire hierarchy
of collections and resources rooted at oldId. The copy succeeds unless
one of these errors occurs:
- no entity exists with the identifier oldId
- the user does not have permission to access the entity oldId
- the user does not have permission to create the entity newId
- the user does not have permission to delete oldId
- overwrite is true, the entity newId exists, and the user does not have permission to delete newId
- overwrite is true, the entity newId exists, and the entity newId (or one of its members) is in use by another user
- overwrite is false and the entity newId already exists
- the containing collection for newId does not exist
- newId is too long to be used as a resource-id or collection-id
- the server is configured to write the resource body to the filesystem and an attempt to save the resource body fails
- the source and destination objects are the same
- writing the new resource puts the user over quota
returns true if a new entity is created, i.e. newId did not exist
Parameters: oldId - Parameters: newId - Parameters: overwrite - true if a new entity is created, i.e. newId did not exist throws: PermissionException - if the user does not have permission to delete the existing entity, or delete/create the new entity. throws: IdUsedException - if overwrite is false and the newId is already in use. throws: IdUnusedException - if oldIdd does not exist. throws: InconsistentException - if the containing collection (for newId) does not exist. throws: IdLengthException - if the newId is too long. throws: InUseException - if the entity specified by oldId is currently in use by another user or, if overwrite is true, the entity identified by newId exists and is in use by another user. throws: ServerOverloadException - if the server is configured to write the resource body to the filesystem and an attempt to save the resource body fails. throws: OverQuotaException - if writing the new resource puts the user over quota |
|
|