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

org.jgroups.protocols.kubernetes.stream.DefaultStreamProvider Maven / Gradle / Ivy

The newest version!
package org.jgroups.protocols.kubernetes.stream;

import java.io.IOException;
import java.io.InputStream;
import java.net.URLConnection;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

public class DefaultStreamProvider extends BaseStreamProvider {
    private static final Logger log = Logger.getLogger(DefaultStreamProvider.class.getName());

    public DefaultStreamProvider() {}

    @Override
    public InputStream openStream(String url, Map headers, int connectTimeout, int readTimeout) throws IOException {
        URLConnection connection = openConnection(url, headers, connectTimeout, readTimeout);
        if (log.isLoggable(Level.FINE)) {
            log.fine(String.format("Using URLConnection for url [%s].", url));
        }
        return connection.getInputStream();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy