try { OperationManager.getInstance().beginOperation(svnClient);   if (!SVNWorkspaceRoot.getSVNFolderFor(destination.getParent()) .isManaged()) { SVNTeamProvider provider = (SVNTeamProvider) RepositoryProvider .getProvider(destination.getProject()); provider.add(new IResource[]{destination.getParent()}, IResource.DEPTH_ZERO, new NullProgressMonitor()); }  if(SVNWorkspaceRoot.getSVNFolderFor(source).getStatus().isAdded()){    source.copy(destination.getFullPath(), force, monitor); svnClient.remove(new File[]{source.getLocation().toFile()},true); tree.deletedFolder(source); }else{ svnClient.move(source.getLocation().toFile(), destination .getLocation().toFile(), true); }
try { OperationManager.getInstance().beginOperation(svnClient);   if (!SVNWorkspaceRoot.getSVNFolderFor(destination.getParent()) .isManaged()) { SVNTeamProvider provider = (SVNTeamProvider) RepositoryProvider .getProvider(destination.getProject()); provider.add(new IResource[] { destination.getParent() }, IResource.DEPTH_ZERO, new NullProgressMonitor()); }
	public boolean moveFolder(IResourceTree tree, IFolder source,			IFolder destination, int updateFlags, IProgressMonitor monitor) {		try {			ISVNLocalFolder resource = new LocalFolder(source);			if (!resource.isManaged())				return false;			monitor.beginTask(null, 1000);			monitor.setTaskName("Working..");			// Check to see if we are synchronized with the local file system.			// If we are in sync then we can			// short circuit this method and do a file system only move.			// Otherwise we have to recursively			// try and move all resources, doing it in a best-effort manner.			boolean force = (updateFlags & IResource.FORCE) != 0;			if (!force					&& !tree.isSynchronized(source, IResource.DEPTH_INFINITE)) {				String message = org.eclipse.core.internal.utils.Policy						.bind(								"localstore.resourceIsOutOfSync", source.getFullPath().toString());//$NON-NLS-1$				IStatus status = new ResourceStatus(IResourceStatus.ERROR,						source.getFullPath(), message);				tree.failed(status);				return true;			}			ISVNClientAdapter svnClient = resource.getRepository()					.getSVNClient();			try {				OperationManager.getInstance().beginOperation(svnClient);				// add destination directory to version control if necessary				// see bug #15				if (!SVNWorkspaceRoot.getSVNFolderFor(destination.getParent())						.isManaged()) {					SVNTeamProvider provider = (SVNTeamProvider) RepositoryProvider							.getProvider(destination.getProject());					provider.add(new IResource[]{destination.getParent()},							IResource.DEPTH_ZERO, new NullProgressMonitor());				}								if(SVNWorkspaceRoot.getSVNFolderFor(source).getStatus().isAdded()){					//can't rename a folder that's in state added, so copy to new location					//remove old location, add new location  					//fix for issue 87 -mml					source.copy(destination.getFullPath(), force, monitor);					svnClient.remove(new File[]{source.getLocation().toFile()},true);					tree.deletedFolder(source);				}else{				svnClient.move(source.getLocation().toFile(), destination						.getLocation().toFile(), true);				}			} catch (SVNClientException e) {				throw SVNException.wrapException(e);			} catch (TeamException e) {				throw SVNException.wrapException(e);			} catch (CoreException e) {				throw SVNException.wrapException(e);			} finally {				OperationManager.getInstance().endOperation();			}			tree.movedFolderSubtree(source, destination);		} catch (SVNException e) {			tree.failed(new org.eclipse.core.runtime.Status(					org.eclipse.core.runtime.Status.ERROR, "SUBCLIPSE", 0,					"Error move Folder " + source.getLocation(), e));			e.printStackTrace();			return true; // we attempted		} finally {			monitor.done();		}		return true;	}