Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.openesb.sdk.model;
 
 import java.util.Map;

Author(s):
David BRASSELY (brasseld at gmail.com)
OpenESB Community
public class LoginRequest extends AbstractRequest {
    private final String username;
    private final String password;
    
    public LoginRequest(String usernameString password) {
        this. = username;
        this. = password;
    }
    public String getUsername() {
        return ;
    }
    public String getPassword() {
        return ;
    }
    @Override
    public HttpMethodName method() {
        return .;
    }
    @Override
    public String uri() {
        return "/authentication/_login";
    }
    
    @Override
    public Map<StringStringheaders() {
        Map<StringStringheaders = super.headers();
        
        String basicAuth = javax.xml.bind.DatatypeConverter.printBase64Binary(
                (getUsername() + ":" + getPassword()).getBytes());
        
        headers.put(."Basic "+basicAuth);
        return headers;
    }
New to GrepCode? Check out our FAQ X