org.jgroups.ping.common.stream.OpenStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common Show documentation
Show all versions of common Show documentation
Kubernetes PING - Common
The newest version!
package org.jgroups.ping.common.stream;
import java.io.InputStream;
import java.util.Map;
import java.util.concurrent.Callable;
public class OpenStream implements Callable {
private final StreamProvider streamProvider;
private final String url;
private final Map headers;
private final int connectTimeout;
private final int readTimeout;
public OpenStream(StreamProvider streamProvider, String url, Map headers, int connectTimeout, int readTimeout) {
this.streamProvider = (streamProvider != null) ? streamProvider : new DefaultStreamProvider();
this.url = url;
this.headers = headers;
this.connectTimeout = connectTimeout;
this.readTimeout = readTimeout;
}
@Override
public InputStream call() throws Exception {
return streamProvider.openStream(url, headers, connectTimeout, readTimeout);
}
}