Examples of MoveMethod


Examples of org.apache.jackrabbit.webdav.client.methods.MoveMethod

         */
        public void move(NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException {
            checkConsumed();
            String uri = getItemUri(srcNodeId, sessionInfo);
            String destUri = getItemUri(destParentNodeId, destName, sessionInfo);
            MoveMethod method = new MoveMethod(uri, destUri, false);

            methods.add(method);
            clear = true;
        }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.client.methods.MoveMethod

     * @see RepositoryService#move(SessionInfo, NodeId, NodeId, Name)
     */
    public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException {
        String uri = getItemUri(srcNodeId, sessionInfo);
        String destUri = getItemUri(destParentNodeId, destName, sessionInfo);
        MoveMethod method = new MoveMethod(uri, destUri, false);
        execute(method, sessionInfo);
        // need to clear the cache as the move may have affected nodes with uuid.
        clearItemUriCache(sessionInfo);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.client.methods.MoveMethod

        String uri = getItemUri(srcNodeId, sessionInfo);
        String destUri = getItemUri(destParentNodeId, destName, sessionInfo);
        if (isDavClass3(sessionInfo)) {
            destUri = obtainAbsolutePathFromUri(destUri);
        }
        MoveMethod method = new MoveMethod(uri, destUri, false);
        execute(method, sessionInfo);
        // need to clear the cache as the move may have affected nodes with uuid.
        clearItemUriCache(sessionInfo);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.client.methods.MoveMethod

            String uri = getItemUri(srcNodeId, sessionInfo);
            String destUri = getItemUri(destParentNodeId, destName, sessionInfo);
            if (isDavClass3(sessionInfo)) {
                destUri = obtainAbsolutePathFromUri(destUri);
            }
            MoveMethod method = new MoveMethod(uri, destUri, false);

            methods.add(method);
            clear = true;
        }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.client.methods.MoveMethod

     * @see RepositoryService#move(SessionInfo, NodeId, NodeId, Name)
     */
    public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException {
        String uri = getItemUri(srcNodeId, sessionInfo);
        String destUri = getItemUri(destParentNodeId, destName, sessionInfo);
        MoveMethod method = new MoveMethod(uri, destUri, false);
        execute(method, sessionInfo);
        // need to clear the cache as the move may have affected nodes with uuid.
        clearItemUriCache(sessionInfo);
    }
View Full Code Here

Examples of org.apache.webdav.lib.methods.MoveMethod

     * @param expect the return status expected.
     * @return the {@link HttpMethod} which contains the response.
     */
    protected HttpMethod move(String url, String destination, int expect)
    {
        MoveMethod moveMethod = new MoveMethod();
        moveMethod.setDoAuthentication(true);
        moveMethod.setPath(url);
        moveMethod.setDestination(destination);
        testMethod(moveMethod, expect);
        return moveMethod;
    }
View Full Code Here

Examples of org.apache.webdav.lib.methods.MoveMethod

        String movedSpaceUrl = SPACES + "/RenamedTestSpace";
        DeleteMethod deleteMethod = new DeleteMethod();
        deleteMethod.setDoAuthentication(true);
        MkcolMethod mkColMethod = new MkcolMethod();
        mkColMethod.setDoAuthentication(true);
        MoveMethod moveMethod = new MoveMethod();
        moveMethod.setDoAuthentication(true);
        try {
            deleteMethod.setPath(spaceUrl);
            assertEquals(DavServletResponse.SC_NO_CONTENT, getHttpClient().executeMethod(deleteMethod));
            deleteMethod.setPath(movedSpaceUrl);
            assertEquals(DavServletResponse.SC_NO_CONTENT, getHttpClient().executeMethod(deleteMethod));
            mkColMethod.setPath(spaceUrl);
            assertEquals(DavServletResponse.SC_CREATED, getHttpClient().executeMethod(mkColMethod));
            moveMethod.setPath(spaceUrl);
            moveMethod.setDestination(relativeDestinationPath);
            assertEquals(DavServletResponse.SC_CREATED, getHttpClient().executeMethod(moveMethod));
            deleteMethod.setPath(movedSpaceUrl);
            assertEquals(DavServletResponse.SC_NO_CONTENT, getHttpClient().executeMethod(deleteMethod));
        } catch (HttpException ex) {
            fail(ex.getMessage());
View Full Code Here

Examples of org.apache.webdav.lib.methods.MoveMethod

     */
    public boolean moveMethod(String source, String destination)
        throws HttpException, IOException {

        setClient();
        MoveMethod method = new MoveMethod(URIUtil.encodePath(source),
                                           URIUtil.encodePath(destination));
        generateIfHeader(method);
        method.setOverwrite(overwrite);
        int statusCode = client.executeMethod(method);

        // Possbile MOVE Status Codes => SC_CREATED, SC_NO_CONTENT
        // WebdavStatus.SC_FORBIDDEN, SC_CONFLICT, SC_PRECONDITION_FAILED,
        // SC_LOCKED, SC_BAD_GATEWAY
View Full Code Here

Examples of org.apache.webdav.lib.methods.MoveMethod

   public static void moveResource(HttpClient client, HttpURL url,
                                   String destination, boolean overwrite)
      throws IOException, HttpException
   {
      MoveMethod move = new MoveMethod(url.getURI(), destination, overwrite);
      move.setFollowRedirects(true);
      int status = client.executeMethod(move);
      switch (status) {
         case WebdavStatus.SC_OK:
         case WebdavStatus.SC_CREATED:
         case WebdavStatus.SC_NO_CONTENT:
             return;

         default:
             HttpException ex = new HttpException();
             ex.setReasonCode(status);
             ex.setReason(move.getStatusText());
             throw ex;
   }
}
View Full Code Here

Examples of org.apache.webdav.lib.methods.MoveMethod

     * @param expect the return status expected.
     * @return the {@link HttpMethod} which contains the response.
     */
    protected HttpMethod move(String url, String destination, int expect)
    {
        MoveMethod moveMethod = new MoveMethod();
        moveMethod.setDoAuthentication(true);
        moveMethod.setPath(url);
        moveMethod.setDestination(destination);
        testMethod(moveMethod, expect);
        return moveMethod;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.