|
10金钱
" D1 {8 g. H" D) y- b& o- public boolean login(){
$ i7 } s8 t. n8 g0 `8 C. T - setupLibrary();( u6 ^3 O8 H# K# F x0 l2 F
- try{% Q. X0 W/ {4 ]; C$ n
- //创建库连接
5 c! o' e' l- s; ]. s - repository=SVNRepositoryFactory.create(SVNURL.parseURIEncoded(this.svnRoot));
' y+ {, m5 S* R* F e( j: h - //身份验证3 e9 W+ R; g* ?
- ISVNAuthenticationManager authManager = SVNWCUtil4 H- s* O; n' n9 V3 |" S: ?5 S |
- .createDefaultAuthenticationManager(this.userName,; x# C* X+ W$ l3 x7 l2 _+ n3 h
- this.password);
a+ `: U5 s% i8 H7 Q% J% I - //创建身份验证管理器. x3 U* Z8 b9 e: B) j
- repository.setAuthenticationManager(authManager);$ {& `: l6 E8 o) M4 v# m
- return true;
& S, H. [; g# F5 }% b8 C, J - } catch(SVNException svne){ a9 _, J: ^3 W+ ?& D
- svne.printStackTrace();
$ j6 ^! q2 A7 @ M4 z2 @( } - return false;
9 g+ Y* b2 w8 t0 _. h - }- l- k" x |3 r6 V: F0 J
- }
复制代码 2 L1 d: q; ^3 I5 f
此段代码经试验,发现在创建身份验证管理器repository.setAuthenticationManager(authManager); 时,即使URL输入错误,也能通过验证,即return true; ,并不能抛出异常返回return false; 。请教各位大神,这是SVNkit本身的bug,还是这段代码的问题呢?: {$ u6 s( j7 L3 A
|
|