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


Java SVNRepositories类代码示例

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


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

示例1: getRepositoryLocation

import org.tigris.subversion.subclipse.core.repo.SVNRepositories; //导入依赖的package包/类
public static ISVNRepositoryLocation getRepositoryLocation(String url) {
  SVNProviderPlugin provider = SVNProviderPlugin.getPlugin();
  SVNRepositories repositories = provider.getRepositories();

  ISVNRepositoryLocation location = null;
  
  ISVNRepositoryLocation[] locations = repositories.getKnownRepositories(new NullProgressMonitor());
  for(int i = 0; i < locations.length; i++ ) {
    String currentUrl = locations[i].getUrl().toString();
    if(url.startsWith(currentUrl)) {
      if(location==null || currentUrl.length()>location.getUrl().toString().length())
      location = locations[i];
    }
  }

  return location;
}
 
开发者ID:subclipse,项目名称:m2e,代码行数:18,代码来源:SubclipseUtils.java

示例2: performOk

import org.tigris.subversion.subclipse.core.repo.SVNRepositories; //导入依赖的package包/类
public boolean performOk() {
      if (showCredentials) {
       if (passwordChanged) {
           location.setPassword(passwordText.getText());
       	passwordChanged = false;
       }
       location.setUsername(loginText.getText());
      }
      if (useCustomLabelButton.getSelection()) {
      	location.setLabel(customLabelText.getText());
      } else {
      	location.setLabel(null);
      }
      
      if (!repositoryRootText.getText().equals("")) { //$NON-NLS-1$
      	try {
		location.setRepositoryRoot(new SVNUrl(repositoryRootText.getText()));
	} catch (MalformedURLException e1) {
              // should not occur, we don't change the url of the root
	}
      } else {
      	location.setRepositoryRoot(null);
      }
      
      try {
          SVNRepositories repositories = SVNProviderPlugin.getPlugin().getRepositories();
          repositories.addOrUpdateRepository(location);

          SVNLightweightDecorator.refresh();
          
} catch (SVNException e) {
	handle(e);
          return false;
}
      
      return true;
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:38,代码来源:SVNRepositoryPropertiesPage.java

示例3: performFinish

import org.tigris.subversion.subclipse.core.repo.SVNRepositories; //导入依赖的package包/类
public boolean performFinish() {
	ISVNClientAdapter client = null;
	try {
		SVNRepositoryLocation newRepository = SVNRepositoryLocation.fromString(urlPage.getNewUrl());
		newRepository.setUsername(repository.getUsername());
		newRepository.setLabel(repository.getLabel());
		newRepository.validateConnection(new NullProgressMonitor());
		client = repository.getSVNClient();
		for (int i = 0; i < sharedProjects.length; i++) {
			client.relocate(repository.getUrl().toString(), newRepository.getUrl().toString(), sharedProjects[i].getLocation().toString(), true);
		}
           SVNRepositories repositories = SVNProviderPlugin.getPlugin().getRepositories();
           repositories.addOrUpdateRepository(newRepository);
		for (int i = 0; i < sharedProjects.length; i++) {
			SVNProviderPlugin.getPlugin().getStatusCacheManager().refreshStatus(sharedProjects[i], true);
			sharedProjects[i].refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
			RepositoryProvider provider = RepositoryProvider.getProvider(sharedProjects[i], SVNProviderPlugin.getTypeId());
			provider.setProject(sharedProjects[i]);
		}
		repositories.disposeRepository(repository);
	} catch (Exception e) {
		MessageDialog.openError(getShell(), Policy.bind("RelocateWizard.heading"), e.getMessage()); //$NON-NLS-1$
		return false;
	}
	finally {
		repository.returnSVNClient(client);
	}
	return true;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:30,代码来源:RelocateWizard.java


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