JcrWorkspace implements org.modeshape.jcr.api.Workspace { @Override public void move( String srcAbsPath, String destAbsPath ) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException { session.checkLive(); CheckArg.isNotEmpty(srcAbsPath, "srcAbsPath"); CheckArg.isNotEmpty(destAbsPath, "destAbsPath"); JcrSession moveSession = this.session.spawnSession(false); moveSession.move(srcAbsPath, destAbsPath); moveSession.save(); } JcrWorkspace( JcrSession session,
                  String workspaceName ); @Override final JcrSession getSession(); @Override final String getName(); @Override void copy( String srcAbsPath,
                      String destAbsPath ); @Override void copy( String srcWorkspace,
                      String srcAbsPath,
                      String destAbsPath ); @Override void clone( String srcWorkspace,
                       String srcAbsPath,
                       String destAbsPath,
                       boolean removeExisting ); @Override void move( String srcAbsPath,
                      String destAbsPath ); @Override @SuppressWarnings("deprecation") void restore( Version[] versions,
                         boolean removeExisting ); @Override JcrLockManager getLockManager(); @Override JcrQueryManager getQueryManager(); @Override javax.jcr.NamespaceRegistry getNamespaceRegistry(); @Override IndexManager getIndexManager(); @Override JcrNodeTypeManager getNodeTypeManager(); @Override ObservationManager getObservationManager(); @Override JcrVersionManager getVersionManager(); @Override JcrRepositoryManager getRepositoryManager(); @Override ContentHandler getImportContentHandler( String parentAbsPath,
                                                   int uuidBehavior ); @Override void importXML( String parentAbsPath,
                           InputStream in,
                           int uuidBehavior ); @Override String[] getAccessibleWorkspaceNames(); @Override void createWorkspace( String name ); @Override void createWorkspace( String name,
                                 String srcWorkspace ); @Override void deleteWorkspace( String name ); @Override void reindex(); @Override void reindex( String pathStr ); @Override void reindexSince( long timestamp ); @Override Future<Boolean> reindexSinceAsync( long timestamp ); @Override Future<Boolean> reindexAsync(); @Override Future<Boolean> reindexAsync( String pathStr ); @Override FederationManager getFederationManager();  }
@Test( expected = IllegalArgumentException.class ) public void shouldNotAllowMoveFromNullPath() throws Exception { workspace.move(null, null); }
@Test public void shouldAllowMoveFromPathToAnotherPathInSameWorkspace() throws Exception { workspace.move("/a/b", "/b/b-copy"); }