本文整理汇总了Java中org.tmatesoft.svn.core.io.SVNRepositoryFactory类的典型用法代码示例。如果您正苦于以下问题:Java SVNRepositoryFactory类的具体用法?Java SVNRepositoryFactory怎么用?Java SVNRepositoryFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SVNRepositoryFactory类属于org.tmatesoft.svn.core.io包,在下文中一共展示了SVNRepositoryFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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();
}
}
示例2: openRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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);
}
示例3: createRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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);
}
}
示例4: testReplayFileModification
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
@Test
public void testReplayFileModification() throws Exception {
try (SvnTestServer server = SvnTestServer.createEmpty()) {
final URL repoMark = ReplayTest.class.getResource("repo/format");
final SVNURL url = SVNURL.fromFile(new File(repoMark.getPath()).getParentFile());
final SVNRepository srcRepo = SVNRepositoryFactory.create(url);
final SVNRepository dstRepo = server.openSvnRepository();
long lastRevision = srcRepo.getLatestRevision();
log.info("Start replay");
for (long revision = 1; revision <= lastRevision; revision++) {
final SVNPropertyValue message = srcRepo.getRevisionPropertyValue(revision, "svn:log");
log.info(" replay commit #{}: {}", revision, StringHelper.getFirstLine(message.getString()));
replayRangeRevision(srcRepo, dstRepo, revision, false);
log.info(" compare revisions #{}: {}", revision, StringHelper.getFirstLine(message.getString()));
compareRevision(srcRepo, revision, dstRepo, dstRepo.getLatestRevision());
}
log.info("End replay");
}
}
示例5: logModificacoesSVN
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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());
}
}
示例6: checkoutTest
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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());
}
示例7: getRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
/**
* Returns the SVN repository used to manage metadata versions in this
* store.
*
* @return the SVN repository used to manage metadata versions in this
* store.
*/
SVNRepository getRepository() throws SVNException {
SVNRepository repository = SVNRepositoryFactory.create(repURL);
String user = MCRSessionMgr.getCurrentSession().getUserInformation().getUserID();
SVNAuthentication[] auth = {
SVNUserNameAuthentication.newInstance(user, false, repURL, false) };
BasicAuthenticationManager authManager = new BasicAuthenticationManager(auth);
repository.setAuthenticationManager(authManager);
return repository;
}
示例8: init
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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);
}
}
示例9: getRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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;
}
示例10: createRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
public void createRepository(File path, String repositoryType)
throws SVNClientException {
if (REPOSITORY_FSTYPE_BDB.equalsIgnoreCase(repositoryType))
throw new SVNClientException("SVNKit only supports fsfs repository type.");
try {
boolean force = false;
boolean enableRevisionProperties = false;
SVNRepositoryFactory.createLocalRepository(path, enableRevisionProperties, force);
} catch (SVNException e) {
notificationHandler.logException(e);
throw new SVNClientException(e);
}
}
示例11: createRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
@Override
public SVNRepository createRepository(SVNURL url, boolean mayReuse) throws SVNException {
final SVNRepository repos = SVNRepositoryFactory.create(url, this);
repos.setAuthenticationManager(myManager);
repos.setTunnelProvider(myTunnelProvider);
repos.setDebugLog(new ProxySvnLog(SVNDebugLog.getDefaultLog()));
repos.setCanceller(new MyCanceller());
return repos;
}
示例12: createRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
@NotNull
public SVNRepository createRepository(@NotNull SVNURL url) throws SVNException {
SVNRepository repository = SVNRepositoryFactory.create(url);
repository.setAuthenticationManager(getAuthenticationManager());
repository.setTunnelProvider(getSvnOptions());
return repository;
}
示例13: getSvnRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的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;
}
示例14: setupType
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
private void setupType(final String url) throws SVNException {
svnurl = SVNURL.parseURIDecoded(url);
if (url.startsWith("http")) {
DAVRepositoryFactory.setup();
repository = SVNRepositoryFactory.create(svnurl);
} else if (url.startsWith("svn")) {
SVNRepositoryFactoryImpl.setup();
repository = SVNRepositoryFactory.create(svnurl);
} else {
FSRepositoryFactory.setup();
repository = SVNRepositoryFactory.create(svnurl);
}
}
示例15: createRepository
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
private SVNRepository createRepository() {
try {
return SVNRepositoryFactory.create(_url);
}
catch (SVNException ex) {
throw new RuntimeException("Invalid repository.", ex);
}
}