/** * Forwards the method call to the underlying workspace. */ public void move(String srcAbsPath, String destAbsPath) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException { workspace.move(srcAbsPath, destAbsPath); }
public void call() throws RepositoryException { String src = testRoot + "/" + nodeName1; String dest = testRoot + "/" + nodeName2; superuser.getWorkspace().move(src, dest); } }, ALL_TYPES);
@Override public void move(String srcAbsPath, String destAbsPath) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException { getWrappedWorkspace().move(srcAbsPath, destAbsPath); }
/** * move content to the specified location. * * @param source source node path * @param destination node where the node has to be moved */ @Override public void moveTo(String source, String destination) throws PathNotFoundException, RepositoryException, AccessDeniedException { this.getWorkspace().move(source, destination); }
/** {@inheritDoc} */ public void move(String from, String to) throws RepositoryException, RemoteException { try { workspace.move(from, to); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
public void execute() throws Exception { getDelegate().move(srcAbsPath, destAbsPath); } });
/** * Operation is performed entirely within the persistent workspace, it does * not involve transient storage and therefore does not require a save */ public void testMoveNodes() throws RepositoryException { String dstAbsPath = node2.getPath() + "/" + node1.getName(); workspace.move(node1.getPath(), dstAbsPath); // there should not be any pending changes after copy assertFalse(superuser.hasPendingChanges()); }
public Object run() throws RepositoryException { String srcPath = pathForId(srcNodeId, sInfo); StringBuffer destPath = new StringBuffer(pathForId(destParentNodeId, sInfo)); if (destPath.length() > 1) { destPath.append("/"); } destPath.append(sInfo.getNamePathResolver().getJCRName(destName)); sInfo.getSession().getWorkspace().move(srcPath, destPath.toString()); return null; } }, sInfo);
public Object run() throws RepositoryException { String srcPath = pathForId(srcNodeId, sInfo); StringBuffer destPath = new StringBuffer(pathForId(destParentNodeId, sInfo)); if (destPath.length() > 1) { destPath.append("/"); } destPath.append(sInfo.getNamePathResolver().getJCRName(destName)); sInfo.getSession().getWorkspace().move(srcPath, destPath.toString()); return null; } }, sInfo);
@Override protected void move(String source, String dest, Session session) throws RepositoryException { session.getWorkspace().move(source, dest); } }
@Override void run(int scale) throws RepositoryException { session.getWorkspace().move("/large-move/s" + scale, "/large-move/t" + scale); } };
public void testWorkspaceMoveNode() throws Exception { Node n = (Node) readOnlySession.getItem(testNodePath); String destPath = testRootNode.getPath() + "/" + nodeName2; try { readOnlySession.getWorkspace().move(n.getPath(), destPath); fail("A read only session must not be allowed to move a node"); } catch (AccessDeniedException e) { // expected log.debug(e.getMessage()); } }
@Override public boolean delete(DeleteContext deleteContext, DavResource resource) throws DavException { try { deleteContext.getSession().getWorkspace().move(resource.getResourcePath(), resource.getResourcePath() + HANDLER_BKP); return true; } catch (RepositoryException e) { return false; } }
protected void doMove(String srcPath, String destPath) throws RepositoryException, LockException, ConstraintViolationException, ItemExistsException, VersionException { if (isSessionMove()) { superuser.move(srcPath, destPath); } else { superuser.getWorkspace().move(srcPath, destPath); } } }
@Test public void workspaceMove() throws RepositoryException { Session session = getAdminSession(); Node node = getNode(TEST_PATH); node.addNode("source").addNode("node"); node.addNode("target"); session.save(); session.getWorkspace().move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved"); assertFalse(node.hasNode("source/node")); assertTrue(node.hasNode("source")); assertTrue(node.hasNode("target/moved")); }
public void move(String srcAbsPath, String destAbsPath) throws RepositoryException { getActionHandler().beforeWorkspaceMove(srcAbsPath, destAbsPath); getDelegate().move(srcAbsPath, destAbsPath); getActionHandler().afterWorkspaceMove(srcAbsPath, destAbsPath); }
public void testMoveJson() throws Exception { Node test = createJsonNode("test.json"); test.getSession().getWorkspace().move(test.getPath(), test.getParent().getPath() + "/target.json"); Session s = getHelper().getReadOnlySession(); try { Property p = s.getNode(testRoot).getNode("target.json").getNode(JcrConstants.JCR_CONTENT) .getProperty(JcrConstants.JCR_DATA); assertEquals(jsondata, IOUtils.toString(p.getBinary().getStream(), "UTF-8")); } finally { s.logout(); } }
/** * @see CopyMoveHandler#move(CopyMoveContext, org.apache.jackrabbit.webdav.DavResource, org.apache.jackrabbit.webdav.DavResource) */ public boolean move(CopyMoveContext context, DavResource source, DavResource destination) throws DavException { try { context.getWorkspace().move(source.getLocator().getRepositoryPath(), destination.getLocator().getRepositoryPath()); return true; } catch (RepositoryException e) { throw new JcrDavException(e); } }
protected void doMove(String srcPath, String destPath) throws RepositoryException, LockException, ConstraintViolationException, ItemExistsException, VersionException { if (saveBeforeMove()) { testRootNode.save(); } if (isSessionMove()) { superuser.move(srcPath, destPath); } else { superuser.getWorkspace().move(srcPath, destPath); } } }
@Override public NodeIterator execute() throws Exception { if (getPath() != null) { String destination = folderPath + "/" + getRandomText(4); getSession().getWorkspace().move(getPath(), destination); } return null; }