All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.storemate.client.call.HeadCallResult Maven / Gradle / Ivy

There is a newer version: 0.8.8
Show newest version
package com.fasterxml.storemate.client.call;

import com.fasterxml.storemate.client.CallFailure;

public abstract class HeadCallResult
    extends CallResult
{
    protected final long _contentLength;

    /*
    ///////////////////////////////////////////////////////////////////////
    // Construction, initialization
    ///////////////////////////////////////////////////////////////////////
     */
    
    protected HeadCallResult(int status, long contentLength)
    {
        super(status);
        _contentLength = contentLength;
    }

    protected HeadCallResult(CallFailure fail)
    {
        super(fail);
        _contentLength = -1;
    }

    /*
    ///////////////////////////////////////////////////////////////////////
    // CallResult impl
    ///////////////////////////////////////////////////////////////////////
     */

    @Override
    public abstract String getHeaderValue(String key);

    /*
    ///////////////////////////////////////////////////////////////////////
    // Extended API
    ///////////////////////////////////////////////////////////////////////
     */
    
    public long getContentLength() { return _contentLength; }
    public boolean hasContentLength() { return _contentLength >= 0L; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy