Example usage for org.apache.http.auth AuthScheme getClass

List of usage examples for org.apache.http.auth AuthScheme getClass

Introduction

In this page you can find the example usage for org.apache.http.auth AuthScheme getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.apache.http.impl.client.BasicAuthCache.java

@Override
public void put(final HttpHost host, final AuthScheme authScheme) {
    Args.notNull(host, "HTTP host");
    if (authScheme == null) {
        return;//www .j a  v  a2 s .  co  m
    }
    if (authScheme instanceof Serializable) {
        try {
            final ByteArrayOutputStream buf = new ByteArrayOutputStream();
            final ObjectOutputStream out = new ObjectOutputStream(buf);
            out.writeObject(authScheme);
            out.close();
            this.map.put(getKey(host), buf.toByteArray());
        } catch (IOException ex) {
            if (log.isWarnEnabled()) {
                log.warn("Unexpected I/O error while serializing auth scheme", ex);
            }
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("Auth scheme " + authScheme.getClass() + " is not serializable");
        }
    }
}