SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(baseUrl)); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(user, password); repository.setAuthenticationManager(authManager); // now do any operation that you want with the *same* repository object repository.checkout(..)
public static SVNRepository repository(SVNURL url, ISVNAuthenticationManager authenticationManager) throws SVNException { SVNRepository repository; repository = SVNRepositoryFactory.create(url); repository.setAuthenticationManager(authenticationManager); return repository; }
private void authenticateIfNecessary(SVNRepository repository) { ISVNAuthenticationManager authManager = getAuthenticationManager(); if (authManager != null) repository.setAuthenticationManager(authManager); }
public static SVNRepository repository(SVNURL url, ISVNAuthenticationManager authenticationManager) throws SVNException { SVNRepository repository; repository = SVNRepositoryFactory.create(url); repository.setAuthenticationManager(authenticationManager); return repository; }
DAVRepositoryFactory.setup(); String url = "(directory in svn url)"; String name = "(login name)"; String password = "(login password)"; SVNRepository repository = null; repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url)); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password); repository.setAuthenticationManager(authManager); SVNDirEntry entry = repository.info(".", -1); System.out.println("Latest Rev: " + entry.getRevision());
public void setAuthenticationManager(ISVNAuthenticationManager authManager) { if (authManager != getAuthenticationManager() && myConnection != null) { myConnection.clearAuthenticationCache(); } super.setAuthenticationManager(authManager); }
private List<String> dirCheckout(SvnOperationFactory svnOperationFactory) throws SVNException { SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(URL),null); repository.setAuthenticationManager(svnOperationFactory.getAuthenticationManager()); Collection<SVNDirEntry> entries = (Collection<SVNDirEntry>) repository.getDir("", (Your Object).getRevision(), null,(Collection<?>) null); Iterator<SVNDirEntry> iterator =entries.iterator(); List<String> list = new ArrayList<String>(); while(iterator.hasNext()){ SVNDirEntry entry =(SVNDirEntry) iterator.next(); if(entry.getKind()==SVNNodeKind.DIR) list.add(entry.getName()); } return list; }
@NotNull private SVNRepository openSvnRepository(@NotNull SVNURL url) throws SVNException { final SVNRepository repo = SVNRepositoryFactory.create(url); if (authManager != null) { repo.setAuthenticationManager(authManager); } return repo; } }
public void setAuthenticationManager(ISVNAuthenticationManager authManager) { DAVConnection connection = getConnection(); if (authManager != getAuthenticationManager() && connection != null) { connection.clearAuthenticationCache(); } super.setAuthenticationManager(authManager); }
public void setAuthenticationManager(ISVNAuthenticationManager authManager) { DAVConnection connection = getConnection(); if (authManager != getAuthenticationManager() && connection != null) { connection.clearAuthenticationCache(); } super.setAuthenticationManager(authManager); }
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); } return mySourceRepository; }
public void setAuthenticationManager(ISVNAuthenticationManager authManager) { DAVConnection connection = getConnection(); if (authManager != getAuthenticationManager() && connection != null) { connection.clearAuthenticationCache(); } super.setAuthenticationManager(authManager); }
@NotNull public static SVNRepository openSvnRepository(@NotNull SVNURL url, @NotNull String userName, @NotNull String password) throws SVNException { final SVNRepository repo = SVNRepositoryFactory.create(url); repo.setAuthenticationManager(BasicAuthenticationManager.newInstance(userName, password.toCharArray())); return repo; }
public void testConnection() throws SVNException { String encodedUrl = SVNEncodingUtil.autoURIEncode(addressSvn); SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(encodedUrl)); repository.setAuthenticationManager(authManager); repository.testConnection(); }
SVNRepository repository = SVNRepositoryFactory.create(url); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(user,password); repository.setAuthenticationManager(authManager); SVNPropertyValue svnPropertyValue = SVNPropertyValue.create("def"); ISVNEditor editor = repository.getCommitEditor("comment", null); editor.openRoot(-1); editor.openDir("dirname", -1); editor.changeDirProperty("myproperty", svnPropertyValue); editor.closeEdit();
SVNRepository repository = SVNRepositoryFactory.create(url); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(user,password); repository.setAuthenticationManager(authManager); ISVNEditor editor = repository.getCommitEditor("comment" , null); editor.openRoot(-1); editor.openFile("/file1.txt", -1); editor.changeFileProperty("/file1.txt", "mypropertyname", SVNPropertyValue.create("myvalue")); editor.closeFile("/file1.txt",null); editor.closeEdit();
private void attemptAccess(ISVNAuthenticationManager m) throws SVNException { SVNRepository repository = SVNRepositoryFactory.create(repo); try { repository.setAuthenticationManager(m); repository.testConnection(); } finally { repository.closeSession(); } }
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); mySourceRepository.setDebugLog(myRepos.getDebugLog()); mySourceRepository.setTunnelProvider(myRepos.getTunnelProvider()); mySourceRepository.setCanceller(myRepos.getCanceller()); } return mySourceRepository; }
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); mySourceRepository.setDebugLog(myRepos.getDebugLog()); mySourceRepository.setTunnelProvider(myRepos.getTunnelProvider()); mySourceRepository.setCanceller(myRepos.getCanceller()); } return mySourceRepository; }
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); mySourceRepository.setDebugLog(myRepos.getDebugLog()); mySourceRepository.setTunnelProvider(myRepos.getTunnelProvider()); mySourceRepository.setCanceller(myRepos.getCanceller()); } return mySourceRepository; }