Skip to content

Commit

Permalink
Merged #254 "Two slight improvement for custom UserService"
Browse files Browse the repository at this point in the history
  • Loading branch information
gitblit committed May 26, 2015
2 parents 7992255 + 3286926 commit 423c870
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/gitblit/manager/UserManager.java
Expand Up @@ -83,9 +83,9 @@ public UserManager(IRuntimeManager runtimeManager, IPluginManager pluginManager)
* @param userService
*/
public void setUserService(IUserService userService) {
logger.info(userService.toString());
this.userService = userService;
this.userService.setup(runtimeManager);
logger.info(userService.toString());
}

@Override
Expand Down Expand Up @@ -115,10 +115,12 @@ public UserManager start() {
// check to see if this "file" is a custom user service class
Class<?> realmClass = Class.forName(realm);
service = (IUserService) realmClass.newInstance();
} catch (Throwable t) {
} catch (ClassNotFoundException t) {
// typical file path configuration
File realmFile = runtimeManager.getFileOrFolder(Keys.realm.userService, "${baseFolder}/users.conf");
service = createUserService(realmFile);
} catch (InstantiationException | IllegalAccessException e) {
logger.error("failed to instanciate user service {}: {}", realm, e.getMessage());
}
}
setUserService(service);
Expand Down

0 comments on commit 423c870

Please sign in to comment.