ContentRest extends BaseRest { private Response copyContent(String spaceID, String contentID, String storeID, String sourceStoreID, String copySource) { StringBuilder msg = new StringBuilder("copying content from ("); msg.append(copySource); msg.append(") to ("); msg.append(spaceID); msg.append(" / "); msg.append(contentID); msg.append(", "); msg.append(storeID); msg.append(")"); log.info(msg.toString()); try { return doCopyContent(spaceID, contentID, storeID, sourceStoreID, copySource); } catch (InvalidIdException e) { return responseBad(msg.toString(), e, BAD_REQUEST); } catch (InvalidRequestException e) { return responseBad(msg.toString(), e, BAD_REQUEST); } catch (ResourceNotFoundException e) { return responseNotFound(msg.toString(), e, NOT_FOUND); } catch (ResourceStateException e) { return responseBad(msg.toString(), e, CONFLICT); } catch (ResourceException e) { return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR); } catch (Exception e) { return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR); } } @Autowired  ContentRest(ContentResource contentResource, RestUtil restUtil); @GET Response getContent(@PathParam("spaceID") String spaceID,
                               @PathParam("contentID") String contentID,
                               @QueryParam("storeID") String storeID,
                               @QueryParam("attachment") boolean attachment,
                               @HeaderParam(RANGE_HEADER) String range); @HEAD Response getContentProperties(@PathParam("spaceID") String spaceID,
                                         @PathParam("contentID") String contentID,
                                         @QueryParam("storeID") String storeID); @POST Response updateContentProperties(@PathParam("spaceID") String spaceID,
                                            @PathParam("contentID") String contentID,
                                            @QueryParam("storeID") String storeID); @PUT Response putContent(@PathParam("spaceID") String spaceID,
                               @PathParam("contentID") String contentID,
                               @QueryParam("storeID") String storeID,
                               @HeaderParam(COPY_SOURCE_HEADER) String copySource,
                               @HeaderParam(COPY_SOURCE_STORE_HEADER) String sourceStoreID); @DELETE Response deleteContent(@PathParam("spaceID") String spaceID,
                                  @PathParam("contentID") String contentID,
                                  @QueryParam("storeID") String storeID);  }
@Test public void testCopyContent() throws Exception { doTestCopyContent(true, 201); }