下面列出了怎么用org.apache.http.impl.auth.NTLMScheme的API类实例代码及写法,或者点击链接到github查看源代码。
private AuthScheme getAuthScheme() {
final String scheme = getProtocolScheme();
if (Constants.BASIC.equals(scheme)) {
return new BasicScheme();
} else if (Constants.DIGEST.equals(scheme)) {
return new DigestScheme();
} else if (Constants.NTLM.equals(scheme)) {
final Properties props = new Properties();
getWebConfig().getConfigParameterMap(ConfigName.CONFIG).entrySet().stream()
.filter(e -> e.getKey().startsWith(Config.JCIFS_PREFIX)).forEach(e -> {
props.setProperty(e.getKey(), e.getValue());
});
return new NTLMScheme(new JcifsEngine(props));
} else if (Constants.FORM.equals(scheme)) {
final Map<String, String> parameterMap = ParameterUtil.parse(getParameters());
return new FormScheme(parameterMap);
}
return null;
}
public AuthScheme newInstance(HttpParams params) {
return new NTLMScheme(new JCIFSEngine());
}
public AuthScheme newInstance(HttpParams params) {
return new NTLMScheme(new JCIFSEngine());
}
@Override
public AuthScheme create(HttpContext context) {
return new NTLMScheme(new JCIFSEngine());
}
public AuthScheme newInstance(HttpParams params) {
return new NTLMScheme(new JCIFSEngine());
}
public AuthScheme newInstance(HttpParams params) {
return new NTLMScheme(new JCIFSEngine());
}
public AuthScheme newInstance(final HttpParams params) {
return new NTLMScheme(new JCIFSEngine());
}