View Javadoc

1   package com.bradmcevoy.http.exceptions;
2   
3   import com.bradmcevoy.http.*;
4   
5   /**
6    *  Indicates that the requested operation could not be performed because of
7    * prior state. Ie there is an existing resource preventing a new one from being
8    * created.
9    */
10  public class ConflictException extends MiltonException {
11  
12       private final String message;
13      
14      /**
15       * The resource idenfitied by the URI.
16       *
17       * @param r
18       */
19      public ConflictException(Resource r) {
20          super(r);
21          this.message = "Conflict exception: " + r.getName();
22      }
23      
24      public ConflictException(Resource r, String message) {
25          super(r);
26          this.message = message;
27      }
28  
29      @Override
30      public String getMessage() {
31          return super.getMessage();
32      }
33      
34      
35      
36      
37      
38  
39  }