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


Java ISVNStatus.getFile方法代码示例

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


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

示例1: collectUnversionedFolders

import org.tigris.subversion.svnclientadapter.ISVNStatus; //导入方法依赖的package包/类
/**
 * Collect the content of unversioned folders.
 * @param statuses
 * @param recursive
 * @return
 */
protected ISVNStatus[] collectUnversionedFolders(ISVNStatus[] statuses, boolean recursive) {
	if (statuses == null) {
		return null;
	}
    List<ISVNStatus> processed = new ArrayList<ISVNStatus>();
    for (ISVNStatus status : statuses) {
    	processed.add(status);
    	if (status.getNodeKind() != SVNNodeKind.FILE && status.getTextStatus() == SVNStatusKind.UNVERSIONED) {
    		File folder = status.getFile();
    		if (!folder.isDirectory() && !folder.exists())
    			continue;
  			Set<String> alreadyProcessed = new HashSet<String>();
			processUnversionedFolder(folder, processed, recursive, alreadyProcessed);
    	}
    }

    return processed.toArray(new ISVNStatus[processed.size()]);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:25,代码来源:StatusUpdateStrategy.java

示例2: getResourceFor

import org.tigris.subversion.svnclientadapter.ISVNStatus; //导入方法依赖的package包/类
public static IResource getResourceFor(IResource parent, ISVNStatus status) {
	if (status == null || status.getFile() == null) {
		return null;
	}
	return getResourceFor(parent, new Path(status.getFile().getAbsolutePath()));
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:7,代码来源:SVNWorkspaceRoot.java

示例3: ResourceStatus

import org.tigris.subversion.svnclientadapter.ISVNStatus; //导入方法依赖的package包/类
/**
 * @param status
 * @param url - Only needed when status.getUrl is Null, such as
 *  for an svn:externals folder
 */
public ResourceStatus(ISVNStatus status, String url, boolean useUrlHack) {
	super();
   	/** a temporary variable serving as immediate cache for various status values */
   	Object aValue = null;

   	aValue = status.getUrlString();
       if (aValue == null) {
       	if (url == null)
       		this.url = null;
       	else
       		this.url = url;
       } else {
           this.url = (String) aValue;
       }

       // This is a hack to get the URL for incoming additions if when URL is null due to a JavaHL bug.
       // See Issue #1312 for details.  This should only be done for RemoteResourceStatus (useUrlHack == true),
       // not LocalResourceStatus.
       if (this.url == null && useUrlHack) {
       	File file = status.getFile();
       	if (file != null) {
       		List<String> segments = new ArrayList<String>();
       		segments.add(file.getName());
       		File parentFile = file.getParentFile();
       		while (parentFile != null) {
       			if (parentFile.exists()) {
       				IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(new Path(parentFile.getPath()));
       				if (container != null) {
						ISVNLocalFolder localFolder = SVNWorkspaceRoot.getSVNFolderFor(container);
						SVNUrl parentUrl = localFolder.getUrl();
						if (parentUrl != null) {
							StringBuffer sb = new StringBuffer(parentUrl.toString());
							for (int i = segments.size() - 1; i >= 0; i--) {
								sb.append("/" + segments.get(i));
							}
							this.url = sb.toString();
							break;
						}
       				}
       			}
       			segments.add(parentFile.getName());
       			parentFile = parentFile.getParentFile();
       		}
       	}
       }

       aValue = status.getLastChangedRevision();
       if (aValue == null) {
           this.lastChangedRevision = SVNRevision.SVN_INVALID_REVNUM;
       } else {
           this.lastChangedRevision = ((SVNRevision.Number) aValue).getNumber();
       }

       aValue = status.getLastChangedDate();
       if (aValue == null) {
           this.lastChangedDate = -1;
       } else {
           this.lastChangedDate = ((Date) aValue).getTime();
       }

       this.lastCommitAuthor = status.getLastCommitAuthor();
       this.textStatus = status.getTextStatus().toInt();
       this.propStatus = status.getPropStatus().toInt();
       this.treeConflicted = status.hasTreeConflict();
       this.fileExternal = status.isFileExternal();
       this.conflictDescriptor = status.getConflictDescriptor();

       this.nodeKind = status.getNodeKind().toInt();
       
       this.file = status.getFile();
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:77,代码来源:ResourceStatus.java


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