| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
package net.sf.arestc.testserver; |
| 20 |
|
|
| 21 |
|
import java.io.IOException; |
| 22 |
|
|
| 23 |
|
import org.apache.http.HttpException; |
| 24 |
|
import org.apache.http.HttpRequest; |
| 25 |
|
import org.apache.http.HttpResponse; |
| 26 |
|
import org.apache.http.HttpStatus; |
| 27 |
|
import org.apache.http.protocol.HttpContext; |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 33 |
|
public class NodeRetrieveHandler extends AbstractRequestHandler { |
| 34 |
|
|
| 35 |
|
|
| 36 |
|
private static final String RESPONSE_FILE_NAME = "stubs/noderetrieveresponse.xml"; |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
public static final String URL = "/alfresco/service/api/node/workspace/SpacesStore/fe424d83-d697-401c-b29e-ce1a915d7283/permissions"; |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
@see |
| 43 |
|
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 44 |
1
|
@Override... |
| 45 |
|
public void handle(final HttpRequest request, final HttpResponse response, |
| 46 |
|
final HttpContext context) throws HttpException, IOException { |
| 47 |
1
|
if ("GET".equals(request.getRequestLine().getMethod())) { |
| 48 |
1
|
response.setStatusCode(HttpStatus.SC_CREATED); |
| 49 |
1
|
response.addHeader("Content-Type", "application/xml"); |
| 50 |
1
|
addFileAsBody(response, RESPONSE_FILE_NAME); |
| 51 |
|
} else { |
| 52 |
0
|
response.setStatusCode(HttpStatus.SC_METHOD_FAILURE); |
| 53 |
|
} |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
} |