use of com.gitblit.transport.ssh.NullKeyManager in project gitblit by gitblit.
the class IPublicKeyManagerProvider method get.
@Override
public synchronized IPublicKeyManager get() {
if (manager != null) {
return manager;
}
IStoredSettings settings = runtimeManager.getSettings();
String clazz = settings.getString(Keys.git.sshKeysManager, FileKeyManager.class.getName());
if (StringUtils.isEmpty(clazz)) {
clazz = FileKeyManager.class.getName();
}
try {
Class<? extends IPublicKeyManager> mgrClass = (Class<? extends IPublicKeyManager>) Class.forName(clazz);
manager = runtimeManager.getInjector().getInstance(mgrClass);
} catch (Exception e) {
logger.error("failed to create public key manager", e);
manager = new NullKeyManager();
}
return manager;
}
Aggregations