| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package net.sf.arestc.configuration; |
| 21 |
|
|
| 22 |
|
import org.apache.commons.httpclient.HttpMethod; |
| 23 |
|
import org.apache.commons.httpclient.methods.DeleteMethod; |
| 24 |
|
import org.apache.commons.httpclient.methods.GetMethod; |
| 25 |
|
import org.apache.commons.httpclient.methods.HeadMethod; |
| 26 |
|
import org.apache.commons.httpclient.methods.PostMethod; |
| 27 |
|
import org.apache.commons.httpclient.methods.PutMethod; |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
@author |
| 33 |
|
|
|
|
|
| 87.5% |
Uncovered Elements: 2 (16) |
Complexity: 7 |
Complexity Density: 0.54 |
|
| 34 |
|
public enum HTTPMethods { |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
HEAD("{0}?{1}"), |
| 38 |
|
GET("{0}?{1}"), |
| 39 |
|
POST("{0}"), |
| 40 |
|
DELETE("{0}?{1}"), |
| 41 |
|
PUT("{0}"); |
| 42 |
|
|
| 43 |
|
private String urlPattern; |
| 44 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 45 |
5
|
private HTTPMethods(final String pattern) {... |
| 46 |
5
|
urlPattern = pattern; |
| 47 |
|
} |
| 48 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 5 |
Complexity Density: 0.45 |
|
| 49 |
5
|
public HttpMethod getMethod(final String source) {... |
| 50 |
5
|
switch (this) { |
| 51 |
1
|
case GET: |
| 52 |
1
|
return new GetMethod(source); |
| 53 |
1
|
case PUT: |
| 54 |
1
|
return new PutMethod(source); |
| 55 |
1
|
case POST: |
| 56 |
1
|
return new PostMethod(source); |
| 57 |
1
|
case DELETE: |
| 58 |
1
|
return new DeleteMethod(source); |
| 59 |
1
|
default: |
| 60 |
1
|
return new HeadMethod(source); |
| 61 |
|
} |
| 62 |
|
} |
| 63 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 64 |
0
|
public String getURLPattern() {... |
| 65 |
0
|
return urlPattern; |
| 66 |
|
} |
| 67 |
|
} |