Clover Coverage Report - ARESTC 0.1.7-SNAPSHOT
Coverage timestamp: Fri Aug 27 2010 19:12:04 CEST
../../../../img/srcFileCovDistChart8.png 54% of files have more coverage
5   56   2   5
2   22   0.4   1
1     2  
1    
 
  NodeRetrieveHandler       Line # 33 5 0% 2 2 75% 0.75
 
  (1)
 
1    /*
2    *
3    * (C)opyright 2010, Nikolaos Georgosopoulos
4    *
5    * This file is part of ARESTC.
6    *
7    * ARESTC is free software: you can redistribute it and/or modify it under the
8    * terms of the Lesser General Public License as published by the Free Software
9    * Foundation, either version 3 of the License, or (at your option) any later
10    * version.
11    *
12    * ARESTC is distributed in the hope that it will be useful, but WITHOUT ANY
13    * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14    * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15    *
16    * You should have received a copy of the Lesser General Public License along
17    * with ARESTC. If not, see <http://www.gnu.org/licenses/>.
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    // TODO: Auto-generated Javadoc
30    /**
31    * The Class NodeRetrieveHandler.
32    */
 
33    public class NodeRetrieveHandler extends AbstractRequestHandler {
34   
35    /** The Constant RESPONSE_FILE_NAME. */
36    private static final String RESPONSE_FILE_NAME = "stubs/noderetrieveresponse.xml";
37   
38    /** The Constant URL. */
39    public static final String URL = "/alfresco/service/api/node/workspace/SpacesStore/fe424d83-d697-401c-b29e-ce1a915d7283/permissions";
40   
41    /* (non-Javadoc)
42    * @see net.sf.arestc.testserver.AbstractRequestHandler#handle(org.apache.http.HttpRequest, org.apache.http.HttpResponse, org.apache.http.protocol.HttpContext)
43    */
 
44  1 toggle @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    }