|
10金钱
; D3 S" f$ H3 k2 r% y- public boolean login(){
5 N( Q0 p0 E% y - setupLibrary();+ a- c9 E* G3 d8 W
- try{
" b8 a! Y+ N- H - //创建库连接
* v: C! t; `; D/ |: f - repository=SVNRepositoryFactory.create(SVNURL.parseURIEncoded(this.svnRoot));
1 R/ G9 E: J, p. W V$ ? - //身份验证. y7 r# e* b7 O t! [$ T
- ISVNAuthenticationManager authManager = SVNWCUtil$ q6 s1 ~% i; y
- .createDefaultAuthenticationManager(this.userName,
( g$ b1 F. e7 q: Q K- @ - this.password);
( e5 k$ c' L9 V/ F+ X. | - //创建身份验证管理器' E4 P% q7 S( u" h7 N3 m% e
- repository.setAuthenticationManager(authManager);
) U) l' v: o+ \4 i - return true;6 e, ^* n r4 a2 S
- } catch(SVNException svne){1 I& X0 d% F* a5 ~
- svne.printStackTrace();
- }( Q2 N- q. }) W - return false;. y O/ ], q B1 @; r
- }! ?' ]/ s7 X% r
- }
复制代码 4 @# q! [2 t2 [- }- `( L0 c
此段代码经试验,发现在创建身份验证管理器repository.setAuthenticationManager(authManager); 时,即使URL输入错误,也能通过验证,即return true; ,并不能抛出异常返回return false; 。请教各位大神,这是SVNkit本身的bug,还是这段代码的问题呢? P3 g& Z" p8 I0 c, s6 V- N( f/ ]
|
|