Java Code Examples for org.tigris.subversion.svnclientadapter.ISVNClientAdapter#removeNotifyListener()

The following examples show how to use org.tigris.subversion.svnclientadapter.ISVNClientAdapter#removeNotifyListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResolveResourcesCommand.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void run(IProgressMonitor monitor) throws SVNException {
	ISVNClientAdapter svnClient = root.getRepository().getSVNClient();
    try {            
        svnClient.addNotifyListener(operationResourceCollector);           
        OperationManager.getInstance().beginOperation(svnClient);           
        for (int i = 0; i < resources.length; i++) {
            svnClient.resolve(resources[i].getLocation().toFile(), resolution);
            monitor.worked(100);
        }
    } catch (SVNClientException e) {
        throw SVNException.wrapException(e);
    } finally {
    	Set<IResource> operationResources = operationResourceCollector.getOperationResources();
        OperationManager.getInstance().endOperation(true, operationResources);
        if (svnClient != null) {
         svnClient.removeNotifyListener(operationResourceCollector);
         root.getRepository().returnSVNClient(svnClient);
        }
        monitor.done();
    }
}
 
Example 2
Source File: UnlockResourcesCommand.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void run(IProgressMonitor monitor) throws SVNException {
      final ISVNClientAdapter svnClient = root.getRepository().getSVNClient();
      
      final File[] resourceFiles = new File[resources.length];
      for (int i = 0; i < resources.length;i++)
          resourceFiles[i] = resources[i].getLocation().toFile(); 
      
      try {
          monitor.beginTask(null, 100);
          
          svnClient.addNotifyListener(operationResourceCollector);
          
          OperationManager.getInstance().beginOperation(svnClient);

          svnClient.unlock(resourceFiles, force);
      } catch (SVNClientException e) {
          throw SVNException.wrapException(e);
      } finally {
      	Set<IResource> operationResources = operationResourceCollector.getOperationResources();
          OperationManager.getInstance().endOperation(true, operationResources);
          svnClient.removeNotifyListener(operationResourceCollector);
          root.getRepository().returnSVNClient(svnClient);
          monitor.done();
      }
}
 
Example 3
Source File: LockResourcesCommand.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void run(IProgressMonitor monitor) throws SVNException {
       final ISVNClientAdapter svnClient = root.getRepository().getSVNClient();
       
       final File[] resourceFiles = new File[resources.length];
       for (int i = 0; i < resources.length;i++)
           resourceFiles[i] = resources[i].getLocation().toFile(); 
       try {
           monitor.beginTask(null, 100);
           
           svnClient.addNotifyListener(operationResourceCollector);
           
           OperationManager.getInstance().beginOperation(svnClient);

           svnClient.lock(resourceFiles,message,force);
       } catch (SVNClientException e) {
           throw SVNException.wrapException(e);
       } finally {
       	Set<IResource> operationResources = operationResourceCollector.getOperationResources();
           OperationManager.getInstance().endOperation(true, operationResources, refreshLocal);
           if (svnClient != null) {
            svnClient.removeNotifyListener(operationResourceCollector);
            root.getRepository().returnSVNClient(svnClient);
           }
           monitor.done();
       }
}
 
Example 4
Source File: LocalResource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void setSvnProperty(String name, String value, boolean recurse) throws SVNException {
	OperationResourceCollector operationResourceCollector = new OperationResourceCollector();
	ISVNClientAdapter svnClient = getRepository().getSVNClient();
	try {			
		svnClient.addNotifyListener(operationResourceCollector);
		OperationManager.getInstance().beginOperation(svnClient);
		svnClient.propertySet(getFile(),name,value,recurse);
	} catch (SVNClientException e) {
		throw SVNException.wrapException(e); 
	} finally {
		OperationManager.getInstance().endOperation(true, operationResourceCollector.getOperationResources());
		if (svnClient != null) {
			svnClient.removeNotifyListener(operationResourceCollector);
			getRepository().returnSVNClient(svnClient);
		}
	}
}
 
Example 5
Source File: LocalResource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public void deleteSvnProperty(String name,boolean recurse) throws SVNException {
	OperationResourceCollector operationResourceCollector = new OperationResourceCollector();
	ISVNClientAdapter svnClient = getRepository().getSVNClient();
	try {			
		svnClient.addNotifyListener(operationResourceCollector);
		OperationManager.getInstance().beginOperation(svnClient);
		svnClient.propertyDel(getFile(),name,recurse);
	} catch (SVNClientException e) {
		throw SVNException.wrapException(e); 
	} finally {
		OperationManager.getInstance().endOperation(true, operationResourceCollector.getOperationResources());
		if (svnClient != null) {
			svnClient.removeNotifyListener(operationResourceCollector);
			getRepository().returnSVNClient(svnClient);
		}
	}
}