diff options
author | James Moger <james.moger@gitblit.com> | 2013-11-19 08:01:23 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-11-29 11:05:50 -0500 |
commit | 5200b359257c2ab5e29781c2b05c6092fc8338f8 (patch) | |
tree | 7d0a02b17ce9897576845d8376ce67fe3f7e9532 /src/main/java/com/gitblit/HtpasswdUserService.java | |
parent | cacf8bff097fbb66a7be1bfe267b5da2605145f8 (diff) | |
download | gitblit-5200b359257c2ab5e29781c2b05c6092fc8338f8.tar.gz gitblit-5200b359257c2ab5e29781c2b05c6092fc8338f8.zip |
Eliminate static singleton calls from user services
Change-Id: Ieec34483822f033b19d3ff3259d071c9bc091ed1
Diffstat (limited to 'src/main/java/com/gitblit/HtpasswdUserService.java')
-rw-r--r-- | src/main/java/com/gitblit/HtpasswdUserService.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/HtpasswdUserService.java b/src/main/java/com/gitblit/HtpasswdUserService.java index a98777b9..3b7120f0 100644 --- a/src/main/java/com/gitblit/HtpasswdUserService.java +++ b/src/main/java/com/gitblit/HtpasswdUserService.java @@ -80,6 +80,7 @@ public class HtpasswdUserService extends GitblitUserService private final boolean SUPPORT_PLAINTEXT_PWD; + private IRuntimeManager runtimeManager; private IStoredSettings settings; private File htpasswdFile; @@ -117,16 +118,16 @@ public class HtpasswdUserService extends GitblitUserService * In addition the setup tries to read and parse the htpasswd file to be used * for authentication. * - * @param settings - * @since 0.7.0 + * @param runtimeManager + * @since 1.4.0 */ @Override - public void setup(IStoredSettings settings) + public void setup(IRuntimeManager runtimeManager) { - this.settings = settings; + this.runtimeManager = runtimeManager; + this.settings = runtimeManager.getSettings(); // This is done in two steps in order to avoid calling GitBlit.getFileOrFolder(String, String) which will segfault for unit tests. - IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class); String file = settings.getString(KEY_BACKING_US, DEFAULT_BACKING_US); File realmFile = runtimeManager.getFileOrFolder(file); serviceImpl = createUserService(realmFile); @@ -293,7 +294,6 @@ public class HtpasswdUserService extends GitblitUserService if ( !file.equals(htpasswdFilePath) ) { // The htpasswd file setting changed. Rediscover the file. this.htpasswdFilePath = file; - IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class); this.htpasswdFile = runtimeManager.getFileOrFolder(file); this.htUsers.clear(); this.forceReload = true; |