本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNClientManager.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java SVNClientManager.newInstance方法的具体用法?Java SVNClientManager.newInstance怎么用?Java SVNClientManager.newInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc.SVNClientManager
的用法示例。
在下文中一共展示了SVNClientManager.newInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSVNClientManager
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public static SVNClientManager getSVNClientManager(String userName, String password) throws SVNException {
/*
* Creates a default run-time configuration options driver. Default
* options created in this way use the Subversion run-time configuration
* area (for instance, on a Windows platform it can be found in the
* '%APPDATA%\Subversion' directory).
*
* readonly = true - not to save any configuration changes that can be
* done during the program run to a config file (config settings will
* only be read to initialize; to enable changes the readonly flag
* should be set to false).
*
* SVNWCUtil is a utility class that creates a default options driver.
*/
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
/*
* Creates an instance of SVNClientManager providing authentication
* information (name, password) and an options driver
*/
return SVNClientManager.newInstance(options, userName, password);
}
示例2: checkout
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private File checkout(String scmUrl) throws Exception {
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
ISVNAuthenticationManager isvnAuthenticationManager = SVNWCUtil.createDefaultAuthenticationManager(null, null, (char[]) null, false);
SVNClientManager svnClientManager = SVNClientManager.newInstance(options, isvnAuthenticationManager);
File out = temp.newFolder();
SVNUpdateClient updateClient = svnClientManager.getUpdateClient();
SvnCheckout co = updateClient.getOperationsFactory().createCheckout();
co.setUpdateLocksOnDemand(updateClient.isUpdateLocksOnDemand());
co.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(scmUrl), SVNRevision.HEAD));
co.setSingleTarget(SvnTarget.fromFile(out));
co.setRevision(SVNRevision.HEAD);
co.setDepth(SVNDepth.INFINITY);
co.setAllowUnversionedObstructions(false);
co.setIgnoreExternals(updateClient.isIgnoreExternals());
co.setExternalsHandler(SvnCodec.externalsHandler(updateClient.getExternalsHandler()));
co.setTargetWorkingCopyFormat(wcVersion);
co.run();
return out;
}
示例3: getClientManager
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private synchronized SVNClientManager getClientManager() {
if (clientManager == null) {
final DefaultSVNOptions options = new DefaultSVNOptions(null, true) {
private String[] ignorePatterns;
{
ignorePatterns = new String[] {};
}
@Override
public String[] getIgnorePatterns() {
return ignorePatterns;
}
};
options.setIgnorePatterns(null);
clientManager = SVNClientManager.newInstance(options, authManager);
}
return clientManager;
}
示例4: setupSVN
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
/**
* Parse the URL and set up the class to connect to the SVN repo
*
* @param url
* Repository's address (valid protocols: http://, svn:// and
* file://)
*/
@SuppressWarnings("deprecation")
private void setupSVN() {
svn_client = SVNClientManager.newInstance();
svn_client.setEventHandler(new SVNEventHandler());
log_handler = new SVNLogHandler();
try {
this.SVN_url = SVNURL.parseURIDecoded(repository_url);
} catch (SVNException e) {
e.printStackTrace();
System.exit(0);
}
SVNRevision start_revision = SVNRevision.create(time_interval
.getStart().toDate());
SVNRevision end_revision = SVNRevision.create(time_interval.getEnd()
.toDate());
revision_range = new SVNRevisionRange(start_revision, end_revision);
}
示例5: initializeClientManager
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private void initializeClientManager()
{
/*
* Creates a default run-time configuration options driver. Default options
* created in this way use the Subversion run-time configuration area (for
* instance, on a Windows platform it can be found in the '%APPDATA%\Subversion'
* directory).
*
* readonly = true - not to save any configuration changes that can be done
* during the program run to a config file (config settings will only
* be read to initialize; to enable changes the readonly flag should be set
* to false).
*
*/
ISVNOptions options = SVNWCUtil.createDefaultOptions( true );
clientManager = SVNClientManager.newInstance( options, getAuthManager() );
}
示例6: getSvn
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private SVNClientManager getSvn(boolean missingLocalOk) throws IOException, IllegalArgumentException
{
if (scm_ == null)
{
if (localFolder_ == null)
{
throw new IllegalArgumentException("localFolder has not yet been set - please call setRootLocation(...)");
}
if (!localFolder_.isDirectory())
{
log.error("The passed in local folder '{}' didn't exist", localFolder_);
throw new IllegalArgumentException("The localFolder must be a folder, and must exist");
}
File svnFolder = new File(localFolder_, ".svn");
if (!missingLocalOk && !svnFolder.isDirectory())
{
log.error("The passed in local folder '{}' does not appear to be a svn repository", localFolder_);
throw new IllegalArgumentException("The localFolder does not appear to be a svn repository");
}
scm_ = SVNClientManager.newInstance();
}
return scm_;
}
示例7: testeCheckOut
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public void testeCheckOut() throws SVNException {
DefaultSVNOptions myOptions = new DefaultSVNOptions();
SVNClientManager clientManager = SVNClientManager.newInstance(myOptions, "kann", senha_ic);
SVNURL url = SVNURL.parseURIDecoded(SVN_SPRING_SECURITY);
File dir = new File(PASTA_WORKSPACE);
if (dir.exists()) {
if (dir.list() != null) {
throw new RuntimeException("Para Esse Teste O diretório [" + PASTA_WORKSPACE + "] deve estar vazio");
}
} else {
dir.mkdir();
}
clientManager.createRepository(url, true);
clientManager.getUpdateClient().doCheckout(url, dir, SVNRevision.UNDEFINED, SVNRevision.HEAD, true);
//// UPDATE
// clientManager.getUpdateClient().doUpdate(dir, SVNRevision.HEAD, true);
//
//// COMMIT
// clientManager.getCommitClient().doCommit(new File[] {new File(dir, "www")}, false, "message", false, true);
}
示例8: getAdminClient
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public SVNAdminClient getAdminClient() {
if (adminClient == null) {
String authenticationId = svnRepository.getAuthenticationId();
if (!StringUtils.isBlank(authenticationId)) {
}
Server serverSettings = mavenContext
.getServerSettings(authenticationId);
String username = serverSettings.getUsername();
String password = serverSettings.getPassword();
DefaultSVNOptions defaultSVNOptions = new DefaultSVNOptions();
SVNClientManager clientManager = SVNClientManager.newInstance(
defaultSVNOptions, username, password);
adminClient = clientManager.getAdminClient();
}
return adminClient;
}
示例9: buildSvnCredentials
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private SVNClientManager buildSvnCredentials ( String scmUserid, String encodedPass ) {
SVNClientManager cm = SVNClientManager.newInstance();
cm.setAuthenticationManager( SVNWCUtil
.createDefaultAuthenticationManager( scmUserid, encryptor.decrypt( encodedPass ) ) );
return cm;
}
示例10: checkoutTest
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public void checkoutTest() throws SVNException {
String checkoutPath = "svn://localhost";
String username = "integration";
String password = "integration";
String checkoutRootPath = new File("/home/jeremie/Developpement/checkoutsvn").getAbsolutePath();
DAVRepositoryFactory.setup();
final SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(checkoutPath));
repository.setAuthenticationManager(SVNWCUtil.createDefaultAuthenticationManager(username, password));
final SVNClientManager clientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager());
final SVNUpdateClient updateClient = clientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
final SVNNodeKind nodeKind = repository.checkPath("", -1);
if (nodeKind == SVNNodeKind.NONE) {
System.err.println("There is no entry at '" + checkoutPath + "'.");
System.exit(1);
} else if (nodeKind == SVNNodeKind.FILE) {
System.err.println("The entry at '" + checkoutPath + "' is a file while a directory was expected.");
System.exit(1);
}
System.out.println("*** CHECKOUT SVN Trunk/Branches ***");
System.out.println("Checkout source: " + checkoutPath);
System.out.println("Checkout destination: " + checkoutRootPath);
System.out.println("...");
try {
traverse(updateClient, repository, checkoutPath, checkoutRootPath, "", true);
} catch (final Exception e) {
System.err.println("ERROR : " + e.getMessage());
e.printStackTrace(System.err);
System.exit(-1);
}
System.out.println("");
System.out.println("Repository latest revision: " + repository.getLatestRevision());
}
示例11: checkout
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
protected String checkout(RemoteSubversionApplicationRepository repo, File directory, String applicationName)
throws ApplicationInvalidException {
try {
DAVRepositoryFactory.setup();
SVNClientManager clientManager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(false),
repo.url.username, repo.url.password);
SVNURL catalogueDirSvn = repo.url.url.appendPath(applicationName, false);
int revision = (int) clientManager.getUpdateClient().doCheckout(catalogueDirSvn, directory,
SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, false);
return Integer.toString(revision);
}
catch (SVNException e) { throw new ApplicationInvalidException(e); }
}
示例12: init
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
/**
* 접속정보 초기화
*
* @작성자 : KYJ
* @작성일 : 2016. 5. 2.
* @param properties
*/
public void init(Properties properties) {
validate();
try {
svnURL = SVNURL.parseURIEncoded(getUrl());
repository = SVNRepositoryFactory.create(svnURL);
if ((getUserId() == null && getUserPassword() == null) || (getUserId().isEmpty() && getUserPassword().isEmpty())) {
authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.getDefaultConfigurationDirectory());
} else {
authManager = SVNWCUtil.createDefaultAuthenticationManager(getUserId(), getUserPassword().toCharArray());
}
repository.setAuthenticationManager(authManager);
DefaultSVNOptions options = new DefaultSVNOptions();
svnManager = SVNClientManager.newInstance(options, authManager);
// svnManager.dispose();
// repository.closeSession();
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
// throw new RuntimeException(e);
}
}
示例13: newSvnClientManager
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
static SVNClientManager newSvnClientManager(SvnConfiguration configuration) {
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
final char[] passwordValue = getCharsOrNull(configuration.password());
final char[] passPhraseValue = getCharsOrNull(configuration.passPhrase());
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(
null,
configuration.username(),
passwordValue,
configuration.privateKey(),
passPhraseValue,
false);
return SVNClientManager.newInstance(options, authManager);
}
示例14: getSVNReposForRevision
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private SVNRepository getSVNReposForRevision(final SVNRepository repository, final long revision) throws SVNException {
SVNClientManager manager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(true), repository.getAuthenticationManager());
try {
SVNWCClient client = manager.getWCClient();
SVNInfo info1 = client.doInfo(repository.getLocation(), SVNRevision.HEAD, SVNRevision.create(revision));
SVNRepository reposForRev = SVNRepositoryFactory.create(info1.getURL());
reposForRev.setAuthenticationManager(repository.getAuthenticationManager());
return reposForRev;
}
finally {
manager.dispose();
}
}
示例15: getLastTag
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public static String getLastTag(String urlSvn, String username, String password) throws SVNException
{
final List<Tag> tags = new ArrayList<Tag>();
//SVNClientManager svnClientManager = SVNClientManager.newInstance();
// SVNRepository svnRepository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(
// urlSvn));
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(username, password);
//svnRepository.setAuthenticationManager(authManager);
SVNClientManager ourClientManager = SVNClientManager.newInstance();
ourClientManager.setAuthenticationManager(authManager);
SVNLogClient svnLogClient = ourClientManager.getLogClient();
svnLogClient.doList(SVNURL.parseURIEncoded(urlSvn), SVNRevision.HEAD,
SVNRevision.HEAD,
false,
SVNDepth.IMMEDIATES,
SVNDirEntry.DIRENT_ALL,
new ISVNDirEntryHandler()
{
private Logger logger = Logger.getLogger("fabriccontroller");
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException
{
if (dirEntry.getRelativePath() == null || dirEntry.getRelativePath().equals(""))
return;
logger.info("tag: " +
dirEntry.getRelativePath() + " - " + dirEntry.getDate() + " - " +
dirEntry.getRevision());
tags.add(new Tag(dirEntry.getRelativePath(), dirEntry.getDate(),
dirEntry.getRevision(), dirEntry.getName()));
}
});
Collections.sort(tags, new Tag.TagComparator());
return tags.get(0).getName();
}