SCMLife.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 3683|回复: 0

[求助] 关于SVN二次开发工具——SVNkit的用户鉴权问题

[复制链接]
发表于 2014-6-29 21:03:15 | 显示全部楼层 |阅读模式
10金钱

; D3 S" f$ H3 k2 r% y
  1. public boolean login(){
    5 N( Q0 p0 E% y
  2.         setupLibrary();+ a- c9 E* G3 d8 W
  3.         try{
    " b8 a! Y+ N- H
  4.                 //创建库连接
    * v: C! t; `; D/ |: f
  5.                 repository=SVNRepositoryFactory.create(SVNURL.parseURIEncoded(this.svnRoot));
    1 R/ G9 E: J, p. W  V$ ?
  6.                 //身份验证. y7 r# e* b7 O  t! [$ T
  7.                 ISVNAuthenticationManager authManager = SVNWCUtil$ q6 s1 ~% i; y
  8.                 .createDefaultAuthenticationManager(this.userName,
    ( g$ b1 F. e7 q: Q  K- @
  9.                   this.password);
    ( e5 k$ c' L9 V/ F+ X. |
  10.                 //创建身份验证管理器' E4 P% q7 S( u" h7 N3 m% e
  11.                 repository.setAuthenticationManager(authManager);
    ) U) l' v: o+ \4 i
  12.                 return true;6 e, ^* n  r4 a2 S
  13.         } catch(SVNException svne){1 I& X0 d% F* a5 ~
  14.                 svne.printStackTrace();
    - }( Q2 N- q. }) W
  15.                 return false;. y  O/ ], q  B1 @; r
  16.         }! ?' ]/ s7 X% r
  17. }
复制代码
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/ ]

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

SCMLife推荐上一条 /1 下一条

QQ|小黑屋|手机版|无图版|SCMLife.com ( 京ICP备06056490号-1 )

GMT+8, 2023-12-9 19:01 , Processed in 0.060808 second(s), 6 queries , Gzip On, MemCache On.

Powered by SCMLife X3.4 Licensed

© 2001-2017 JoyShare.

快速回复 返回顶部 返回列表