FileDocCategorySizeDatePackage
NTUserPrincipal.javaAPI DocAndroid 1.5 API3595Wed May 06 22:41:10 BST 2009org.apache.http.auth

NTUserPrincipal

public class NTUserPrincipal extends Object implements Principal
NT (MS Windows specific) user principal used for HTTP authentication
author
Oleg Kalnichevski
since
4.0

Fields Summary
private final String
username
private final String
domain
private final String
ntname
Constructors Summary
public NTUserPrincipal(String domain, String username)

        super();
        if (username == null) {
            throw new IllegalArgumentException("User name may not be null");
        }
        this.username = username;
        if (domain != null) {
            this.domain = domain.toUpperCase(Locale.ENGLISH);
        } else {
            this.domain = null;
        }
        if (this.domain != null && this.domain.length() > 0) {
            StringBuilder buffer = new StringBuilder();
            buffer.append(this.domain);
            buffer.append('/");
            buffer.append(this.username);
            this.ntname = buffer.toString();
        } else {
            this.ntname = this.username;
        }
    
Methods Summary
public booleanequals(java.lang.Object o)

        if (o == null) return false;
        if (this == o) return true;
        if (o instanceof NTUserPrincipal) {
            NTUserPrincipal that = (NTUserPrincipal) o;
            if (LangUtils.equals(this.username, that.username)
                    && LangUtils.equals(this.domain, that.domain)) {
                return true;
            }
        }
        return false;
    
public java.lang.StringgetDomain()

        return this.domain;
    
public java.lang.StringgetName()

        return this.ntname;
    
public java.lang.StringgetUsername()

        return this.username;
    
public inthashCode()

        int hash = LangUtils.HASH_SEED;
        hash = LangUtils.hashCode(hash, this.username);
        hash = LangUtils.hashCode(hash, this.domain);
        return hash;
    
public java.lang.StringtoString()

        return this.ntname;