本文整理汇总了Java中org.tigris.subversion.svnclientadapter.ISVNInfo.getRepository方法的典型用法代码示例。如果您正苦于以下问题:Java ISVNInfo.getRepository方法的具体用法?Java ISVNInfo.getRepository怎么用?Java ISVNInfo.getRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tigris.subversion.svnclientadapter.ISVNInfo
的用法示例。
在下文中一共展示了ISVNInfo.getRepository方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateRootUrl
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
/**
* @param resource
* @return rootURL
*/
private SVNUrl updateRootUrl(ISVNResource resource) {
ISVNClientAdapter client = null;
try {
client = SVNProviderPlugin.getPlugin().getSVNClient();
SVNProviderPlugin.disableConsoleLogging();
ISVNInfo info = client.getInfo(resource.getUrl());
SVNProviderPlugin.enableConsoleLogging();
if (info.getRepository() == null)
return resource.getUrl();
else {
// update the saved root URL
resource.getRepository().setRepositoryRoot(info.getRepository());
return info.getRepository();
}
} catch (Exception e) {
SVNProviderPlugin.enableConsoleLogging();
return resource.getUrl();
} finally {
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
}
示例2: setSharing
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
/**
* Set the sharing for a project to enable it to be used with the SVNTeamProvider.
* This is used when a project has .svn directory but is not shared in Eclipse.
* An exception is thrown if project does not have a remote directory counterpart
*/
public static void setSharing(IProject project, IProgressMonitor monitor) throws TeamException {
// Ensure provided info matches that of the project
LocalResourceStatus status = peekResourceStatusFor(project);
// this folder needs to be managed but also to have a remote counter-part
// because we need to know its url
// we will change this exception !
if (!status.hasRemote())
throw new SVNException(new SVNStatus(IStatus.ERROR, Policy.bind("SVNProvider.infoMismatch", project.getName())));//$NON-NLS-1$
String repositoryURL = null;
ISVNClientAdapter client = SVNProviderPlugin.getPlugin().getSVNClient();
try {
SVNProviderPlugin.disableConsoleLogging();
ISVNInfo info = client.getInfoFromWorkingCopy(project.getLocation().toFile());
if (info.getRepository() != null)
repositoryURL = info.getRepository().toString();
} catch (SVNClientException e) {
} finally {
SVNProviderPlugin.enableConsoleLogging();
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
if (repositoryURL == null)
repositoryURL = status.getUrlString();
// Ensure that the provided location is managed
SVNProviderPlugin.getPlugin().getRepositories().getRepository(repositoryURL, false);
// Register the project with Team
RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
}
示例3: validateConnection
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
public void validateConnection(IProgressMonitor monitor) throws SVNException {
ISVNClientAdapter svnClient = getSVNClient();
try {
// we try to get the list of directories and files using the connection
ISVNInfo info = svnClient.getInfo(getUrl());
repositoryRootUrl = info.getRepository();
} catch (SVNClientException e) {
// If the validation failed, dispose of any cached info
dispose();
throw SVNException.wrapException(e);
}
}
示例4: getRootURL
import org.tigris.subversion.svnclientadapter.ISVNInfo; //导入方法依赖的package包/类
private String getRootURL(ISVNLocalResource localResource) {
if (!atomicCommit)
return null;
ISVNInfo info = getSVNInfo(localResource);
if (info == null)
return null;
SVNUrl repos = info.getRepository();
if (repos == null)
return null;
return repos.toString();
}