当前位置: 首页>>代码示例>>Java>>正文


Java ISVNNotifyListener类代码示例

本文整理汇总了Java中org.tigris.subversion.svnclientadapter.ISVNNotifyListener的典型用法代码示例。如果您正苦于以下问题:Java ISVNNotifyListener类的具体用法?Java ISVNNotifyListener怎么用?Java ISVNNotifyListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISVNNotifyListener类属于org.tigris.subversion.svnclientadapter包,在下文中一共展示了ISVNNotifyListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRepository

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void createRepository(File path, String repositoryType) throws SVNClientException {
	try {
		String fsType = (repositoryType == null) ? REPOSITORY_FSTYPE_FSFS : repositoryType; 
	    notificationHandler.setCommand(ISVNNotifyListener.Command.CREATE_REPOSITORY);
	     
	    notificationHandler.logCommandLine(
	    		MessageFormat.format(
	    				"create --fstype {0} {1}", 
						(Object[])new String[] { fsType, fileToSVNPath(path, false) }));
	    svnAdmin.create(path, false, false, null, fsType);
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);            
	}        
    
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:17,代码来源:JhlClientAdapter.java

示例2: addDirectory

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void addDirectory(File dir, boolean recurse, boolean force)
     throws SVNClientException {
     try {
         notificationHandler.setCommand(ISVNNotifyListener.Command.ADD);            
         notificationHandler.logCommandLine(
             "add"+
             (recurse?"":" -N")+
             (force?" --force":"")+
             " "+dir.toString());
notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(dir));
boolean noIgnores = false;
boolean addParents = true;
         svnClient.add(fileToSVNPath(dir, false), Depth.infinityOrEmpty(recurse), force, noIgnores, addParents);
     } catch (ClientException e) {
         notificationHandler.logException(e);
         throw new SVNClientException(e);
     }
 }
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:19,代码来源:AbstractJhlClientAdapter.java

示例3: revpropset

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
/**
 * <p>
 * Set <tt>propName</tt> to <tt>propVal</tt> on revision <tt>revision</tt>.</p>
 * 
 * @param propName name of the property.
 * @param propValue New value to set <tt>propName</tt> to.
 * @param target Local path or URL to resource.
 * @param force If the propset should be forced.
 */
void revpropset(String propName, String propValue, String target, String revision, boolean force)
	throws CmdLineException {
       setCommand(ISVNNotifyListener.Command.PROPSET, false);
	CmdArguments args = new CmdArguments();
	args.add("propset");
	args.add(propName);
	
	args.add("--revprop");
	
	args.add(propValue);
	args.add(target);
	
	args.add("-r");
	args.add(revision);

	if (force)
		args.add("--force");
       args.addAuthInfo(this.user, this.pass);
       args.addConfigInfo(this.configDir);        
	execVoid(args);
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:31,代码来源:SvnCommandLine.java

示例4: copy

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void copy(File srcPath, SVNUrl destUrl, String message)
	throws SVNClientException {
	try {
       	String fixedMessage = fixSVNString(message);
       	if (fixedMessage == null)
       		fixedMessage = "";
		notificationHandler.setCommand(ISVNNotifyListener.Command.COPY);
		String src = fileToSVNPath(srcPath, false);
		String dest = destUrl.toString();
		notificationHandler.logCommandLine("copy " + src + " " + dest);
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(srcPath));
		List<CopySource> copySources = new ArrayList<CopySource>();
		copySources.add(new CopySource(src, Revision.WORKING, Revision.WORKING));
		svnClient.copy(copySources, dest, true, true, true, null, new JhlCommitMessage(fixedMessage), null);
		// last parameter is not used
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:21,代码来源:AbstractJhlClientAdapter.java

示例5: unlock

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
/**
   * @param paths Represents either WC paths, or repository URIs.
   * @param comment The comment to use for the lock operation.
   * @param force Whether to include <code>--force</code> in the
   * command-line.
   */
  String unlock(Object[] paths, boolean force) throws CmdLineException {
      setCommand(ISVNNotifyListener.Command.UNLOCK, true);
CmdArguments args = new CmdArguments();
args.add("unlock");
if (force)
    args.add("--force");
args.addAuthInfo(this.user, this.pass);
      args.addConfigInfo(this.configDir);
        
      for (int i = 0; i < paths.length;i++) {
      	args.add(paths[i]);
      }
      
return execString(args,false);
  }
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:22,代码来源:SvnCommandLine.java

示例6: remove

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void remove(File file[], boolean force) throws SVNClientException {
       try {
           notificationHandler.setCommand(ISVNNotifyListener.Command.REMOVE);
           
           String commandLine = "delete"+(force?" --force":"");
           Set<String> targets = new HashSet<String>(file.length);
           
           for (int i = 0; i < file.length;i++) {
               targets.add(fileToSVNPath(file[i], false));
           }
           commandLine = appendPaths(commandLine, targets);
           
           notificationHandler.logCommandLine(commandLine);
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(file));
  
           svnClient.remove(targets, force, false, null, null, null);
       } catch (ClientException e) {
           notificationHandler.logException(e);
           throw new SVNClientException(e);
       }           
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:22,代码来源:AbstractJhlClientAdapter.java

示例7: doExport

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void doExport(
	SVNUrl srcUrl,
	File destPath,
	SVNRevision revision,
	boolean force)
	throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.EXPORT);
		String src = srcUrl.toString();
		String dest = fileToSVNPath(destPath, false);
		notificationHandler.logCommandLine(
			"export -r " + revision.toString() + ' ' + src + ' ' + dest);
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(destPath));
		svnClient.doExport(src, dest, JhlConverter.convert(revision), Revision.HEAD, force, false, Depth.infinity, null);
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:20,代码来源:AbstractJhlClientAdapter.java

示例8: move

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void move(File srcPath, File destPath, boolean force) throws SVNClientException {
       // use force when you want to move file even if there are local modifications
       try {
           notificationHandler.setCommand(ISVNNotifyListener.Command.MOVE);
	    Set<String> src = new HashSet<String>();
	    src.add(fileToSVNPath(srcPath, false));
           String dest = fileToSVNPath(destPath, false);
           notificationHandler.logCommandLine(
                   "move "+fileToSVNPath(srcPath, false)+' '+dest);
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(new File[] {srcPath, destPath}));        
           svnClient.move(src,dest,force, false, false,null,null,null);
       } catch (ClientException e) {
           notificationHandler.logException(e);
           throw new SVNClientException(e);
       }                   	
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:17,代码来源:AbstractJhlClientAdapter.java

示例9: update

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public long[] update(File[] path, SVNRevision revision, int depth, boolean setDepth, boolean ignoreExternals, boolean force) 
       throws SVNClientException
{
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.UPDATE);
		Set<String> targets = new HashSet<String>(path.length);
		for (int i = 0; i < path.length; i++) {
			targets.add(fileToSVNPath(path[i], false));
		}
		Depth d = JhlConverter.depth(depth);
		StringBuffer commandLine = new StringBuffer(appendPaths("update ", targets) + " -r " +
				revision.toString() + depthCommandLine(d));
	    if (ignoreExternals) commandLine.append(" --ignore-externals");
	    if (force) commandLine.append(" --force");          					
           notificationHandler.logCommandLine(commandLine.toString());
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
		notificationHandler.holdStats();
		boolean makeParents = false;
		long[] rtnCode =  svnClient.update(targets, JhlConverter.convert(revision), d, setDepth, makeParents, ignoreExternals, force);
		notificationHandler.releaseStats();
		return rtnCode;
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}    	
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:27,代码来源:AbstractJhlClientAdapter.java

示例10: getContent

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public InputStream getContent(SVNUrl url, SVNRevision revision, SVNRevision pegRevision)
	throws SVNClientException {
	try {
		notificationHandler.setCommand(
			ISVNNotifyListener.Command.CAT);
		String commandLine = "cat -r "
               + revision
               + " "
               + url;
		if (pegRevision != null) {
			commandLine = commandLine + "@"	+ pegRevision;
		}
           notificationHandler.logCommandLine(commandLine);
		notificationHandler.setBaseDir();                
		
		byte[] contents = svnClient.fileContent(url.toString(), JhlConverter.convert(revision), JhlConverter.convert(pegRevision));
		InputStream input = new ByteArrayInputStream(contents);
		return input;
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:24,代码来源:AbstractJhlClientAdapter.java

示例11: getProperties

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public ISVNProperty[] getProperties(File path, boolean descend) throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.PROPLIST);
		String target = fileToSVNPath(path, false);
		StringBuffer commandLine = new StringBuffer("propList ");
		if (descend) {
			commandLine.append(" -R ");
		}
		commandLine.append(target);
		notificationHandler.logCommandLine(commandLine.toString());
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
		JhlProplistCallback callback = new JhlProplistCallback(true);
		if (descend) {
			svnClient.properties(target, null, null, Depth.infinity, null, callback);
		} else {
			svnClient.properties(target, null, null, Depth.empty, null, callback);
		}
		return callback.getPropertyData();
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}		
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:24,代码来源:AbstractJhlClientAdapter.java

示例12: getPropertiesIncludingInherited

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
private ISVNProperty[] getPropertiesIncludingInherited(String path, boolean isFile) throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.PROPLIST);
		notificationHandler.logCommandLine(
				"proplist "+ path);
		notificationHandler.setBaseDir();
		InheritedJhlProplistCallback callback = new InheritedJhlProplistCallback(isFile);
		Revision revision = null;
		if (!isFile) {
			revision = JhlConverter.convert(SVNRevision.HEAD);
		}
		svnClient.properties(path, revision, revision, Depth.empty, null, callback);
		return callback.getPropertyData();
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}				
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:19,代码来源:AbstractJhlClientAdapter.java

示例13: propertySet

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void propertySet(
	SVNUrl url,
	SVNRevision.Number baseRev,
	String propertyName,
	String propertyValue,
	String message)
	throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.PROPSET);
		if (propertyName.startsWith("svn:")) {
			// Normalize line endings in property value
			svnClient.propertySetRemote(url.toString(), baseRev.getNumber(), propertyName, fixSVNString(propertyValue).getBytes(), new JhlCommitMessage(message), false, null, new JhlCommitCallback());
		} else {
			svnClient.propertySetRemote(url.toString(), baseRev.getNumber(), propertyName, propertyValue.getBytes(), new JhlCommitMessage(message), false, null, new JhlCommitCallback());
		}			
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:21,代码来源:AbstractJhlClientAdapter.java

示例14: propertyGet

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public ISVNProperty propertyGet(File path, String propertyName)
	throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.PROPGET);

		String target = fileToSVNPath(path, false);
		notificationHandler.logCommandLine(
			"propget " + propertyName + " " + target);
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
		byte[] bytes = svnClient.propertyGet(target, propertyName, null, null);
           if (bytes == null)
               return null;
           else
		    return JhlPropertyData.newForFile(target, propertyName, bytes);
	} catch (ClientException e) {
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}

}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:21,代码来源:AbstractJhlClientAdapter.java

示例15: getInfoFromWorkingCopy

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public ISVNInfo getInfoFromWorkingCopy(File path) throws SVNClientException {
	try {
		notificationHandler.setCommand(ISVNNotifyListener.Command.INFO);
           
		String target = fileToSVNPath(path, false);
		notificationHandler.logCommandLine("info "+target);
		notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(path));
		JhlInfoCallback callback = new JhlInfoCallback();
		
		svnClient.info2(target, null, null, Depth.empty, null, callback);
		ISVNInfo[] items = callback.getInfo();
           if (items == null) {
           	return new SVNInfoUnversioned(path);
           } 
           return items[0];
	} catch (ClientException e) {
		if (e.getAprError() == ErrorCodes.wcNotDirectory || e.getAprError() == ErrorCodes.wcPathNotFound) {
			return new SVNInfoUnversioned(path);
		}
		else {
			notificationHandler.logException(e);
			throw new SVNClientException(e);   
		}
	}        
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:26,代码来源:AbstractJhlClientAdapter.java


注:本文中的org.tigris.subversion.svnclientadapter.ISVNNotifyListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。