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

The following examples show how to use org.tigris.subversion.svnclientadapter.ISVNClientAdapter#propertySet() . 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: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testPropertyListUrl(String filePath) throws Exception {
    createAndCommitParentFolders(filePath);
    File file = createFile(filePath);
    add(file);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(file, "p1", "v1", false);
    c.propertySet(file, "p2", "v2", false);
    c.propertySet(file, "p3", "v3", false);
    commit(file);
    
    assertPropertyStatus(SVNStatusKind.NORMAL, file);

    ISVNProperty[] props = c.getProperties(getFileUrl(file));
    Map<String, ISVNProperty> propMap = new HashMap<String, ISVNProperty>();
    for (ISVNProperty p : props) {
        propMap.put(p.getName(), p);                    
    }
    assertEquals(3, propMap.size());
    assertProperty("p1", "v1", propMap);        
    assertProperty("p2", "v2", propMap);        
    assertProperty("p3", "v3", propMap);        
}
 
Example 2
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testPropertySetGetDel(String filePath) throws Exception {
    createAndCommitParentFolders(filePath);
    File file = createFile(filePath);
    add(file);
    commit(file);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(file, "p1", "v1", false);

    assertNotifiedFiles(file);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);

    assertProperty(c, file, "p1", "v1");
            
    clearNotifiedFiles();
    c.propertyDel(file, "p1", false);
    assertPropertyStatus(SVNStatusKind.NONE, file);
    assertNotifiedFiles(file);
}
 
Example 3
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testPropertyListFile(String filePath) throws Exception {
    createAndCommitParentFolders(filePath);
    File file = createFile(filePath);
    add(file);
    commit(file);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(file, "p1", "v1", false);
    c.propertySet(file, "p2", "v2", false);
    c.propertySet(file, "p3", "v3", false);
    assertNotifiedFiles(file);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);

    ISVNProperty[] props = c.getProperties(file);
    Map<String, ISVNProperty> propMap = new HashMap<String, ISVNProperty>();
    for (ISVNProperty p : props) {
        propMap.put(p.getName(), p);                    
    }
    assertEquals(3, propMap.size());
    assertProperty("p1", "v1", propMap);        
    assertProperty("p2", "v2", propMap);        
    assertProperty("p3", "v3", propMap);        
}
 
Example 4
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testPropertySetGetDelFile() throws Exception {                                                
    File file = createFile("file");        
    add(file);
    commit(file);
    File prop = createFile("prop");
    write(prop, 2);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(file, "p1", prop, false);
    assertNotifiedFiles(file);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);

    assertProperty(c, file, "p1", new byte[] {2});
    
    clearNotifiedFiles();
    c.propertyDel(file, "p1", true);
    assertPropertyStatus(SVNStatusKind.NONE, file);        
    assertNotifiedFiles(file);
}
 
Example 5
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testPropertySetNonRecursivelly() throws Exception {                                                
    File folder = createFolder("folder");        
    File file = createFolder(folder, "file");        
    File folder1 = createFolder(folder, "folder1");        
    File file1 = createFolder(folder1, "file1");        
    
    add(folder);
    add(file);
    add(folder1);
    add(file1);
    commit(getWC());
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(folder, "p1", "v1", false);
    assertNotifiedFiles(folder);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder);
    assertPropertyStatus(SVNStatusKind.NONE, file);
    assertPropertyStatus(SVNStatusKind.NONE, folder1);
    assertPropertyStatus(SVNStatusKind.NONE, file1);
    
    assertProperty(c, folder, "p1", "v1");        
}
 
Example 6
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testPropertySetFileNonRecursivelly() throws Exception {                                                
    File folder = createFolder("folder");        
    File file = createFolder(folder, "file");        
    File folder1 = createFolder(folder, "folder1");        
    File file1 = createFolder(folder1, "file1");        
    
    add(folder);
    add(file);
    add(folder1);
    add(file1);
    commit(getWC());

    File prop = createFile("prop");
    write(prop, 2);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(folder, "p1", prop, false);
    assertNotifiedFiles(folder);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder);
    assertPropertyStatus(SVNStatusKind.NONE, file);
    assertPropertyStatus(SVNStatusKind.NONE, folder1);
    assertPropertyStatus(SVNStatusKind.NONE, file1);
    
    assertProperty(c, folder, "p1", new byte[] {2});        
}
 
Example 7
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testKWPropertySet () throws Exception {                                                
    File folder = createFolder("folder");        
    File file1 = createFile(folder, "file1");        
    
    add(folder);
    add(file1);
    commit(getWC());
 
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(file1, "svn:keywords", "Id", false);
    assertNotifiedFiles(file1);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);
    
    // add property for new file
    File file2 = createFile(folder, "file2");
    assertStatus(SVNStatusKind.UNVERSIONED, file2);
    c.addFile(file2);
    assertStatus(SVNStatusKind.ADDED, file2);
    
    c.propertySet(file2, "svn:keywords", "Id", false);
    assertNotifiedFiles(file2);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file2);
    
}
 
Example 8
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 9
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void testPropertyGetUrl(String filePath) throws Exception {
    createAndCommitParentFolders(filePath);
    File file = createFile(filePath);
    add(file);
            
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(file, "p1", "v1", false);

    commit(file);
    
    assertPropertyStatus(SVNStatusKind.NORMAL, file);

    assertProperty(c, getFileUrl(file), "p1", "v1");                
}
 
Example 10
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testPropertySetGetDelRecursivelly() throws Exception {                                                
    File folder = createFolder("folder");        
    File file = createFolder(folder, "file");        
    File folder1 = createFolder(folder, "folder1");        
    File file1 = createFolder(folder1, "file1");        
    
    add(folder);
    add(file);
    add(folder1);
    add(file1);
    commit(getWC());
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(folder, "p1", "v1", true);
    assertNotifiedFiles(folder, file, folder1, file1);

    assertPropertyStatus(SVNStatusKind.MODIFIED, file);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder1);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);
    
    assertProperty(c, file, "p1", "v1");
    assertProperty(c, folder, "p1", "v1");
    assertProperty(c, folder1, "p1", "v1");
    assertProperty(c, file1, "p1", "v1");                
    
    clearNotifiedFiles();
    c.propertyDel(folder, "p1", true);
    assertPropertyStatus(SVNStatusKind.NONE, folder);
    assertPropertyStatus(SVNStatusKind.NONE, file);
    assertPropertyStatus(SVNStatusKind.NONE, folder1);
    assertPropertyStatus(SVNStatusKind.NONE, file1);
    assertNotifiedFiles(folder, file, folder1, file1);
}
 
Example 11
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testPropertySetGetDelFileRecursivelly() throws Exception {                                                
    File folder = createFolder("folder");        
    File file = createFolder(folder, "file");        
    File folder1 = createFolder(folder, "folder1");        
    File file1 = createFolder(folder1, "file1");        
    
    add(folder);
    add(file);
    add(folder1);
    add(file1);
    commit(getWC());

    File prop = createFile("prop");
    write(prop, 2);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(folder, "p1", prop, true);
    assertNotifiedFiles(folder, file, folder1, file1);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder1);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);
    
    assertProperty(c, file, "p1", new byte[] {2});
    assertProperty(c, folder, "p1", new byte[] {2});
    assertProperty(c, folder1, "p1", new byte[] {2});
    assertProperty(c, file1, "p1", new byte[] {2});
    
    clearNotifiedFiles();
    c.propertyDel(folder, "p1", true);
    assertPropertyStatus(SVNStatusKind.NONE, folder);
    assertPropertyStatus(SVNStatusKind.NONE, file);
    assertPropertyStatus(SVNStatusKind.NONE, folder1);
    assertPropertyStatus(SVNStatusKind.NONE, file1);    
    assertNotifiedFiles(folder, file, folder1, file1);
}
 
Example 12
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testPropertyDelNonRecursivelly() throws Exception {                                                
    File folder = createFolder("folder");        
    File file = createFolder(folder, "file");        
    File folder1 = createFolder(folder, "folder1");        
    File file1 = createFolder(folder1, "file1");        
    
    add(folder);
    add(file);
    add(folder1);
    add(file1);
    commit(getWC());

    ISVNClientAdapter c = getNbClient();        
    c.propertySet(folder, "p1", "v1", true);
    assertNotifiedFiles(folder, file, folder1, file1);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder1);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);
    
    assertProperty(c, file, "p1", "v1");
    assertProperty(c, folder, "p1", "v1");
    assertProperty(c, folder1, "p1", "v1");
    assertProperty(c, file1, "p1", "v1");
    
    clearNotifiedFiles();
    c.propertyDel(folder, "p1", false);
    assertPropertyStatus(SVNStatusKind.NONE, folder);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder1);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);        
    assertNotifiedFiles(folder);
}
 
Example 13
Source File: PropertyTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testPropertyDelFileNonRecursivelly() throws Exception {                                                
    File folder = createFolder("folder");        
    File file = createFolder(folder, "file");        
    File folder1 = createFolder(folder, "folder1");        
    File file1 = createFolder(folder1, "file1");        
    
    add(folder);
    add(file);
    add(folder1);
    add(file1);
    commit(getWC());

    File prop = createFile("prop");
    write(prop, 2);
    
    ISVNClientAdapter c = getNbClient();        
    c.propertySet(folder, "p1", prop, true);
    assertNotifiedFiles(folder, file, folder1, file1);
    
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder1);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);
    
    assertProperty(c, file, "p1", new byte[] {2});
    assertProperty(c, folder, "p1", new byte[] {2});
    assertProperty(c, folder1, "p1", new byte[] {2});
    assertProperty(c, file1, "p1", new byte[] {2});
    
    clearNotifiedFiles();
    c.propertyDel(folder, "p1", false);
    assertPropertyStatus(SVNStatusKind.NONE, folder);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file);
    assertPropertyStatus(SVNStatusKind.MODIFIED, folder1);
    assertPropertyStatus(SVNStatusKind.MODIFIED, file1);        
    assertNotifiedFiles(folder);
}