com.imperva.shcf4j.httpcomponents.client4.CredentialsAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shcf4j-httpcomponents-client4 Show documentation
Show all versions of shcf4j-httpcomponents-client4 Show documentation
The Simple HTTP Client Facade for Java (SHCF4J) serves as a simple facade or abstraction for various HTTP client frameworks (e.g. java.net.HttpURLConnection, Apache HttpClient, etc.) allowing the end user to plug in the desired HTTP client framework at deployment time.
package com.imperva.shcf4j.httpcomponents.client4;
import org.apache.http.auth.Credentials;
import java.security.Principal;
class CredentialsAdapter implements Credentials {
private final com.imperva.shcf4j.auth.Credentials credentials;
public CredentialsAdapter(com.imperva.shcf4j.auth.Credentials credentials) {
this.credentials = credentials;
}
public Principal getUserPrincipal() {
return this.credentials.getUserPrincipal();
}
@Override
public String getPassword() {
return this.credentials.getPassword();
}
}