public SvnRoot(SvnFilesystem filesystem, SVNRepository repository) { this.filesystem = filesystem; this.repository = repository; this.clientManager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(true), repository.getAuthenticationManager()); this.comment = "sushi commit"; }
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); } return mySourceRepository; }
private String getDiffText(SVNRepository repository, SVNURL url, SVNLogEntryPath entry, long revision) { try { SVNClientManager clientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager()); SVNDiffClient diffClient = clientManager.getDiffClient(); ByteArrayOutputStream out = new ByteArrayOutputStream(); SVNRevision startRevision = SVNRevision.create(revision - 1); SVNRevision endRevision = SVNRevision.create(revision); diffClient.doDiff(url, startRevision, startRevision, endRevision, SVNDepth.FILES, true, out); String diffText = out.toString("UTF-8"); if (diffText.length() > MAX_SIZE_OF_A_DIFF) { log.error("diffs for " + entry.getPath() + " too big"); diffText = "-- TOO BIG --"; } return diffText; } catch (Exception e) { return ""; } }
private HTTPSSLKeyManager createKeyManager() { if (!myIsSecured) { return null; } SVNURL location = myRepository.getLocation(); ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager(); String sslRealm = "<" + location.getProtocol() + "://" + location.getHost() + ":" + location.getPort() + ">"; return new HTTPSSLKeyManager(authManager, sslRealm, location); }
private HTTPSSLKeyManager createKeyManager() { if (!myIsSecured) { return null; } SVNURL location = myRepository.getLocation(); ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager(); String sslRealm = "<" + location.getProtocol() + "://" + location.getHost() + ":" + location.getPort() + ">"; return new HTTPSSLKeyManager(authManager, sslRealm, location); }
public SvnRoot(SvnFilesystem filesystem, SVNRepository repository) { this.filesystem = filesystem; this.repository = repository; this.clientManager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(true), repository.getAuthenticationManager()); this.comment = "sushi commit"; filesystem.getWorld().onShutdown().onShutdown(this); }
private HTTPSSLKeyManager createKeyManager() { if (!myIsSecured) { return null; } SVNURL location = myRepository.getLocation(); ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager(); String sslRealm = "<" + location.getProtocol() + "://" + location.getHost() + ":" + location.getPort() + ">"; return new HTTPSSLKeyManager(authManager, sslRealm, location); }
@Override public void reset() { SVNRepository repository = null; try { SVNRevision revision = SVNRevision.HEAD; SVNURL url = SVNURL.parseURIEncoded(path); repository = SVNRepositoryFactory.create(url); authenticateIfNecessary(repository); SVNClientManager ourClientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager()); SVNUpdateClient updateClient = ourClientManager.getUpdateClient(); updateClient.setIgnoreExternals(false); updateClient.doCheckout(url, new File(workingCopyPath), revision, revision, SVNDepth.INFINITY, true); } catch (Exception e) { throw new RuntimeException(e); } finally { if (repository != null) repository.closeSession(); } }
@Override public void checkout(String id) { SVNRepository repository = null; try { clearWorkingCopy(); SVNRevision revision = SVNRevision.create(Integer.parseInt(id)); SVNURL url = SVNURL.parseURIEncoded(path); repository = SVNRepositoryFactory.create(url); authenticateIfNecessary(repository); SVNClientManager ourClientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager()); SVNUpdateClient updateClient = ourClientManager.getUpdateClient(); updateClient.setIgnoreExternals(false); updateClient.doCheckout(url, new File(workingCopyPath), revision, revision, SVNDepth.INFINITY, true); } catch (Exception e) { throw new RuntimeException(e); } finally { if (repository != null) repository.closeSession(); } }
public void export(Node dest, long revision) throws IOException, SVNException { Exporter exporter; SVNRepository sub; SVNRepository repository; repository = root.getRepository(); this.checkDirectory(); dest.checkDirectory(); exporter = new Exporter(revision, dest); if (path.length() == 0) { sub = repository; } else { // repository updates has a target to restrict the result, but it supports // only one segment. So I have to create a new repository ... sub = SvnFilesystem.repository(getSvnurl(), root.getRepository().getAuthenticationManager()); } sub.update(revision, "", true, exporter, exporter); }
public void export(Node dest, long revision) throws IOException, SVNException { Exporter exporter; SVNRepository sub; SVNRepository repository; repository = root.getRepository(); this.checkDirectory(); dest.checkDirectory(); exporter = new Exporter(revision, dest); if (path.length() == 0) { sub = repository; } else { // repository updates has a target to restrict the result, but it supports // only one segment. So I have to create a new repository ... sub = SvnFilesystem.repository(getSvnurl(), root.getRepository().getAuthenticationManager()); } sub.update(revision, "", true, exporter, exporter); }
svnRepository.getAuthenticationManager(); SVNLogClient svnLogClient = new SVNLogClient(svnManager, null);
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; }
SVNRepositoryFactory.create(context.createUrl()); ISVNAuthenticationManager svnManager = svnRepository.getAuthenticationManager(); SVNLogClient svnLogClient = new SVNLogClient(svnManager, null);
private ISVNSSLManager promptSSLClientCertificate(boolean firstAuth) throws SVNException { SVNURL location = myRepository.getLocation(); ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager(); ISVNSSLManager sslManager = null; SVNSSLAuthentication sslAuth = null; String sslRealm = "<" + location.getProtocol() + "://" + location.getHost() + ":" + location.getPort() + ">"; if (myIsSecured) { sslManager = authManager != null ? authManager.getSSLManager(location) : null; } if (authManager != null && sslManager != null && sslManager.isClientCertPromptRequired()) { if (firstAuth) { sslAuth = (SVNSSLAuthentication) authManager.getFirstAuthentication(ISVNAuthenticationManager.SSL, sslRealm, location); } else { sslAuth = (SVNSSLAuthentication) authManager.getNextAuthentication(ISVNAuthenticationManager.SSL, sslRealm, location); } if (sslAuth == null) { SVNErrorManager.cancel("SSL authentication with client certificate cancelled"); } sslManager.setClientAuthentication(sslAuth); } return sslManager; }
int port = location.getPort(); ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager(); ISVNProxyManager proxyAuth = authManager != null ? authManager.getProxyManager(location) : null; if (proxyAuth != null && proxyAuth.getProxyHost() != null) { mySocket = myIsSecured ? SVNSocketFactory.createSSLSocket(sslManager, host, port) : SVNSocketFactory.createPlainSocket(host, port); long timeout = myRepository.getAuthenticationManager() != null ? myRepository.getAuthenticationManager().getHTTPTimeout(myRepository) : DEFAULT_HTTP_TIMEOUT; if (timeout < 0) { timeout = DEFAULT_HTTP_TIMEOUT;
int port = location.getPort(); ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager(); ISVNProxyManager proxyAuth = authManager != null ? authManager.getProxyManager(location) : null; int connectTimeout = authManager != null ? authManager.getConnectTimeout(myRepository) : 0;
int port = location.getPort(); ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager(); ISVNProxyManager proxyAuth = authManager != null ? authManager.getProxyManager(location) : null; int connectTimeout = authManager != null ? authManager.getConnectTimeout(myRepository) : 0;