Class CopyToAPI


  • @Component
    public class CopyToAPI
    extends BaseAPI
    The v0 REST API for copy-to (which supports multi-item copy).
    Since:
    2.6
    Author:
    Tom Page
    • Constructor Detail

      • CopyToAPI

        public CopyToAPI()
    • Method Detail

      • copyTo

        public org.apache.http.HttpResponse copyTo​(String user,
                                                   String password,
                                                   String targetContainerPath,
                                                   List<String> nodeRefs)
        Copy a list of nodes to the target container.
        Parameters:
        user - The username of the user to use.
        password - The password of the user.
        targetContainerPath - The destination to copy the nodes to. This should be in the format "{site}/{container}/{path}", "{site}/{container}", "{store_type}/{store_id}/{id}/{path}", "{store_type}/{store_id}/{id}" or "{store_type}/{store_id}".
        nodeRefs - The list of nodes to copy.
        Returns:
        The HTTP Response.
        Throws:
        AssertionError - If the API call didn't return a 200 response.
      • copyTo

        public org.apache.http.HttpResponse copyTo​(String user,
                                                   String password,
                                                   int expectedStatusCode,
                                                   String targetContainerPath,
                                                   List<String> nodeRefs)
        Copy a list of nodes to the target container.
        Parameters:
        user - The username of the user to use.
        password - The password of the user.
        expectedStatusCode - The expected return status code.
        targetContainerPath - The destination to copy the nodes to. This should be in the format "{site}/{container}/{path}", "{site}/{container}", "{store_type}/{store_id}/{id}/{path}", "{store_type}/{store_id}/{id}" or "{store_type}/{store_id}".
        nodeRefs - The list of nodes to copy.
        Returns:
        The HTTP Response.
        Throws:
        AssertionError - If the API didn't return the expected status code.