本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNWCUtil.createDefaultAuthenticationManager方法的典型用法代码示例。如果您正苦于以下问题:Java SVNWCUtil.createDefaultAuthenticationManager方法的具体用法?Java SVNWCUtil.createDefaultAuthenticationManager怎么用?Java SVNWCUtil.createDefaultAuthenticationManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc.SVNWCUtil
的用法示例。
在下文中一共展示了SVNWCUtil.createDefaultAuthenticationManager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connectToSVNInstance
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
public static SVNRepository connectToSVNInstance(String url, String usr,
String pass) {
SvnUtil.setupLibrary();
SVNRepository repository = null;
try {
repository = SvnUtil.createRepository(url);
} catch (SVNException svne) {
System.err
.println("error while creating an SVNRepository for location '"
+ url + "': " + svne.getMessage());
}
ISVNAuthenticationManager authManager = SVNWCUtil
.createDefaultAuthenticationManager(usr, pass);
repository.setAuthenticationManager(authManager);
try {
SvnUtil.verifySVNLocation(repository, url);
} catch (SVNException e) {
e.printStackTrace();
}
return repository;
}
示例2: init
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private void init() {
logger.info("Creating MySVNClient for svn " + svn_url + ", username " + username + ", password " + password.replaceAll(".", "\\*"));
DAVRepositoryFactory.setup( );
SVNURL url;
try {
url = SVNURL.parseURIDecoded(svn_url);
repository = SVNRepositoryFactory.create( url );
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager( username , password );
repository.setAuthenticationManager( authManager );
} catch (SVNException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例3: checkout
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的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;
}
示例4: getCommits
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
@Override
public List<Commit> getCommits() {
System.out.println("Getting commit log...");
ISVNAuthenticationManager authManager = SVNWCUtil
.createDefaultAuthenticationManager("guest", "");
svn_client.setAuthenticationManager(authManager);
SVNLogClient log_client = svn_client.getLogClient();
try {
log_client.doLog(SVN_url, new String[] { "" },
SVNRevision.UNDEFINED, revision_range.getStartRevision(),
revision_range.getEndRevision(), false, true, 0,
log_handler);
} catch (SVNException e) {
e.printStackTrace();
}
return log_handler.getCommits();
}
示例5: getAuthManager
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private ISVNAuthenticationManager getAuthManager()
{
if ( getPrivateKey() != null )
{
SVNSSHAuthentication[] auth = new SVNSSHAuthentication[1];
auth[0] = new SVNSSHAuthentication( getUser(), getPrivateKey().toCharArray(), getPassphrase(), -1, false );
return new BasicAuthenticationManager( auth );
}
else if ( getUser() != null )
{
return new BasicAuthenticationManager( getUser(), getPassword() );
}
else
{
String configDirectory = SvnUtil.getSettings().getConfigDirectory();
return SVNWCUtil.createDefaultAuthenticationManager(
configDirectory == null ? null : new File( configDirectory ), getUser(), getPassword(),
SvnUtil.getSettings().isUseAuthCache() );
}
}
示例6: openRepository
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private void openRepository() throws Exception {
repository = null;
try {
repository = SVNRepositoryFactory.create(SVNURL
.parseURIEncoded(this.url));
} catch (SVNException svne) {
logger.log(Level.WARNING,
"error while creating an SVNRepository for the location '"
+ this.url + "': " + svne.getMessage(), true);
// StateBar.setState(Icons.ERROR, stateOpenRepositoryFailed);
throw new Exception("Can't access svn!!!");
}
ISVNAuthenticationManager authManager = SVNWCUtil
.createDefaultAuthenticationManager(name, password);
repository.setAuthenticationManager(authManager);
}
示例7: createRepository
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
/**
* Set up repository. This method also determines the head revision of the
* repository.
*
* @throws ConQATException
* if setup fails.
*/
protected SVNRepository createRepository() throws ConQATException {
DAVRepositoryFactory.setup();
FSRepositoryFactory.setup();
try {
SVNRepository repository = SVNRepositoryFactory.create(SVNURL
.parseURIEncoded(url));
ISVNAuthenticationManager authManager;
if (userName != null) {
authManager = SVNWCUtil.createDefaultAuthenticationManager(
userName, password);
} else {
authManager = SVNWCUtil.createDefaultAuthenticationManager();
}
repository.setAuthenticationManager(authManager);
return repository;
} catch (SVNException e) {
throw new ConQATException(e);
}
}
示例8: logModificacoesSVN
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
public void logModificacoesSVN() throws SVNException {
ISVNAuthenticationManager aManager = SVNWCUtil.createDefaultAuthenticationManager("kann", senha_ic);
SVNURL url = SVNURL.parseURIEncoded(SVN_PEIXE_ESPADA);
SVNRepository repos = SVNRepositoryFactory.create(url);
repos.setAuthenticationManager(aManager);
long headRevision = repos.getLatestRevision();
Collection<SVNDirEntry> entriesList = repos.getDir("", headRevision, null, (Collection) null);
for (SVNDirEntry entry : entriesList) {
System.out.println("Entrada: " + entry.getName());
System.out.println("Última modificação da revisão: " + entry.getDate() +
" por " + entry.getAuthor());
System.out.println(" --> MSG: "+entry.getCommitMessage());
}
}
示例9: init
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的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);
}
}
示例10: getRepository
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private SVNRepository getRepository(String url) throws SVNException {
DAVRepositoryFactory.setup();
SVNURL svnUrl = SVNURL.parseURIEncoded(url);
SVNRepository repository = SVNRepositoryFactory.create(svnUrl, null);
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager();
repository.setAuthenticationManager(authManager);
return repository;
}
示例11: newSvnClientManager
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的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);
}
示例12: getSvnRepository
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private SVNRepository getSvnRepository(String url) throws SVNException {
SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url));
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(
settings.getUsername(), settings.getPassword());
repository.setAuthenticationManager(authManager);
return repository;
}
示例13: Subversion
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
public Subversion(final String url, final String user, final String pass) throws SVNException {
try {
setupType(url);
authManager = SVNWCUtil.createDefaultAuthenticationManager(user, pass);
((DefaultSVNAuthenticationManager) authManager).setAuthenticationForced(true);
repository.setAuthenticationManager(authManager);
checkRoot();
} catch (final SVNException e) {
dispose();
throw e;
}
}
示例14: main
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public static void main(String args[]) throws Exception {
File importDir = new File(args[1] + "\\Repository\\");
if (!importDir.exists())
importDir.mkdirs();
String username = "guest";
String password = "";
String srcRepositoryURL = args[0];
ByteArrayOutputStream stream = new ByteArrayOutputStream();
SVNDiffClient diff = new SVNDiffClient(
SVNWCUtil
.createDefaultAuthenticationManager(username, password),
SVNWCUtil.createDefaultOptions(true));
ISVNDiffGenerator defaultSVNDiffGenerator = diff.getDiffGenerator();
defaultSVNDiffGenerator.setDiffAdded(true);
defaultSVNDiffGenerator.setDiffDeleted(true);
diff.setDiffGenerator(defaultSVNDiffGenerator);
diff.doDiff(SVNURL.parseURIDecoded(srcRepositoryURL), SVNRevision.HEAD,
SVNRevision.create(263024), SVNRevision.create(263817),
SVNDepth.UNKNOWN, false, stream);
Writer writer = new BufferedWriter(new FileWriter(new File(importDir
+ "\\arquivo.txt")));
writer.write(stream.toString());
writer.close();
}
示例15: setUp
import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
DAVRepositoryFactory.setup();
_repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(getSvnLocation()));
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(getUsername(), getPassword());
_repository.setAuthenticationManager(authManager);
}