• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ISVNNotifyListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getInfo

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


示例17: info

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
/**
 * info: Display info about a resource.
 * usage: info [PATH [PATH ... ]]
 *
 *   Print information about PATHs.
 *
 * Valid options:
 *   --targets arg            : pass contents of file ARG as additional args
 *   -R [--recursive]         : descend recursively
 * 
 * @param path
 * @return String with the info call result
 */
String info(String[] target) throws CmdLineException {
       if (target.length == 0) {
           // otherwise we would do a "svn info" without args
           return ""; 
       }
       
       setCommand(ISVNNotifyListener.Command.INFO, false);
       CmdArguments args = new CmdArguments();
	args.add("info");
       args.addConfigInfo(this.configDir);
       for (int i = 0;i < target.length;i++) {
           args.add(target[i]);
       }

	return execString(args,false);
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:30,代码来源:SvnCommandLine12.java


示例18: merge

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
/**
 * Update the working copy to mirror a new URL within the repository.
 */
String merge(String path1, String revision1, String path2, String revision2, String localPath, boolean force, boolean recurse, boolean dryRun, boolean ignoreAncestry) throws CmdLineException {
    setCommand(ISVNNotifyListener.Command.MERGE, true);
    CmdArguments args = new CmdArguments();
    args.add("merge");
    if (!recurse)
    	args.add("-N");
    if (force)
    	args.add("--force");
    if (ignoreAncestry)
    	args.add("--ignore-ancestry");
    if (dryRun)
    	args.add("--dry-run");
    if (path1.equals(path2)) {
    	args.add("-r");
    	args.add(validRev(revision1) + ":" + validRev(revision2));
    	args.add(path1);
    } else {
    	args.add(path1 + "@" + validRev(revision1));
    	args.add(path2 + "@" + validRev(revision2));
    }
    args.add(localPath);
    args.addAuthInfo(this.user, this.pass);
    args.addConfigInfo(this.configDir);        
    return execString(args,false);
}
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:29,代码来源:SvnCommandLine.java


示例19: lock

import org.tigris.subversion.svnclientadapter.ISVNNotifyListener; //导入依赖的package包/类
public void lock(File[] paths, String comment, boolean force)
            throws SVNClientException {
        try {
            notificationHandler.setCommand(ISVNNotifyListener.Command.LOCK);
            Set<String> files = new HashSet<String>(paths.length);
            String commandLine = "lock -m \""+comment+"\"";
            if (force)
                commandLine+=" --force";

            for (int i = 0; i < paths.length; i++) {
                files.add(fileToSVNPath(paths[i], false));
            }
            commandLine = appendPaths(commandLine, files);
            notificationHandler.logCommandLine(commandLine);
			notificationHandler.setBaseDir(SVNBaseDir.getBaseDir(paths));

            svnClient.lock(files, comment, force);
            for (String file : files) {
            	notificationHandler.notifyListenersOfChange(file);
			}
        } catch (ClientException e) {
            notificationHandler.logException(e);
//            throw new SVNClientException(e);
        }

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


示例20: unlock

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ShortType类代码示例发布时间:2022-05-22
下一篇:
Java Signal类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap