View Javadoc

1   package com.bradmcevoy.http;
2   
3   import com.bradmcevoy.http.exceptions.BadRequestException;
4   import com.bradmcevoy.http.exceptions.ConflictException;
5   import com.bradmcevoy.http.exceptions.NotAuthorizedException;
6   
7   /**
8    * Implement this to allow your resource to be deleted by webdav clients.
9    *
10   * Milton will ensure there are no locks which prevent the delete, however the
11   * current user might have the resource locked in which case your implementation
12   *
13   * Usually milton will recursively call delete on all children within a collection
14   * being deleted. However you can prevent this my implementing DeletableCollectionResource
15   * which causes milton to ONLY call delete on the specific resource being deleted. In
16   * which case it is your responsibility to test for locks on all child resources
17   * 
18   */
19  public interface DeletableResource extends Resource{
20  
21      /**
22       * Non-recursive delete of this resource. Milton will call delete on child
23       * resources first.
24       *
25       * @throws NotAuthorizedException - if the operation should not be permitted for security reasons
26       * @throws ConflictException - if there is some pre-condition that has not been met, or there is
27       * aspect of the resource state which prevents the resource from being deleted
28       * @throws BadRequestException - if there is some aspect of the request which means
29       * it is not sufficient to perform a delete.
30       */
31      void delete() throws NotAuthorizedException, ConflictException, BadRequestException;
32      
33  }