com.fasterxml.clustermate.client.jdk.JdkHttpHeadCallResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clustermate-client-jdk Show documentation
Show all versions of clustermate-client-jdk Show documentation
ClusterMate NetworkClient implementation built on default
JDK-provided HTTP client (HTTPUrlConnection)
package com.fasterxml.clustermate.client.jdk;
import java.net.HttpURLConnection;
import com.fasterxml.clustermate.client.CallFailure;
import com.fasterxml.clustermate.client.call.HeadCallResult;
public class JdkHttpHeadCallResult extends HeadCallResult
{
protected final HttpURLConnection _connection;
/*
/**********************************************************************
/* Construction, initialization
/**********************************************************************
*/
public JdkHttpHeadCallResult(HttpURLConnection connection,
int status, long contentLength)
{
super(status, contentLength);
_connection = connection;
}
public JdkHttpHeadCallResult(CallFailure fail) {
super(fail);
_connection = null;
}
public static JdkHttpHeadCallResult notFound() {
return new JdkHttpHeadCallResult(null, 404, -1);
}
/*
/**********************************************************************
/* Accessors
/**********************************************************************
*/
@Override
public String getHeaderValue(String key)
{
if (_connection != null) {
return _connection.getHeaderField(key);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy