Changeset 852 for java/SVNAccess/src/net/oni2
- Timestamp:
- May 3, 2013, 2:25:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/SVNAccess/src/net/oni2/svnaccess/SVN.java
r764 r852 5 5 import java.io.File; 6 6 import java.util.Vector; 7 8 import net.oni2.ProxySettings; 7 9 8 10 import org.tmatesoft.svn.core.SVNDepth; … … 10 12 import org.tmatesoft.svn.core.SVNException; 11 13 import org.tmatesoft.svn.core.SVNURL; 14 import org.tmatesoft.svn.core.auth.BasicAuthenticationManager; 15 import org.tmatesoft.svn.core.auth.SVNAuthentication; 12 16 import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; 13 17 import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory; … … 30 34 SVNClientManager svnCManager = null; 31 35 32 /** 33 * Constructor 34 */ 35 public SVN() { 36 private void setup() { 36 37 // For using over http:// and https:// 37 38 DAVRepositoryFactory.setup(); … … 40 41 // For using over file:/// 41 42 FSRepositoryFactory.setup(); 42 43 svnCManager = SVNClientManager.newInstance(SVNWCUtil 44 .createDefaultOptions(true)); 43 } 44 45 private void setProxy(BasicAuthenticationManager authMan) { 46 ProxySettings prox = ProxySettings.getInstance(); 47 if (prox.validate()) { 48 authMan.setProxy(prox.getHostOrIp(), prox.getPort(), null, null); 49 } 50 } 51 52 private BasicAuthenticationManager getAuthManager() { 53 BasicAuthenticationManager auth = new BasicAuthenticationManager( 54 new SVNAuthentication[0]); 55 setProxy(auth); 56 return auth; 57 } 58 59 private BasicAuthenticationManager getAuthManager(String username, 60 String password) { 61 BasicAuthenticationManager auth = new BasicAuthenticationManager( 62 username, password); 63 setProxy(auth); 64 return auth; 65 } 66 67 /** 68 * Constructor 69 */ 70 public SVN() { 71 setup(); 72 73 svnCManager = SVNClientManager.newInstance( 74 SVNWCUtil.createDefaultOptions(true), getAuthManager()); 45 75 } 46 76 … … 54 84 */ 55 85 public SVN(String username, String password) { 56 // For using over http:// and https:// 57 DAVRepositoryFactory.setup(); 58 // For using over svn:// and svn+xxx:// 59 SVNRepositoryFactoryImpl.setup(); 60 // For using over file:/// 61 FSRepositoryFactory.setup(); 86 setup(); 62 87 63 88 svnCManager = SVNClientManager.newInstance( 64 SVNWCUtil.createDefaultOptions(true), username, password); 89 SVNWCUtil.createDefaultOptions(true), 90 getAuthManager(username, password)); 65 91 } 66 92
Note:
See TracChangeset
for help on using the changeset viewer.