Java Utililty Methods URL to InputStream

List of utility methods to do URL to InputStream

Description

The list of methods to do URL to InputStream are organized into topic(s).

Method

InputStreamopenStream(URL url)
open Stream
return url.openStream();
InputStreamopenStream(URL url)
<#if locale="en">

Get InputStream from URL .

try {
    URLConnection connection = url.openConnection();
    connection.setUseCaches(false);
    return connection.getInputStream();
} catch (IOException e) {
    throw new RuntimeException(e);
InputStreamopenStream(URL url, int connectTimeout, int readTimeout)
Open a stream for the given URL with custom timeouts
URLConnection conn = url.openConnection();
conn.setConnectTimeout(connectTimeout);
conn.setReadTimeout(readTimeout);
return conn.getInputStream();
InputStreamopenStreamUseCache(URL url)
Similar to url.openStream except that the accessed resource may be a cached copy.
URLConnection connection = openConnectionUseCache(url);
return connection.getInputStream();
InputStreamopenURL(String url)
open stream from URL.
try {
    return new URL(url + BIOPORTAL_OPTIONS).openStream();
} catch (Exception ex) {
return null;
InputStreamopenURLStream(String in)
open URL Stream
URL inUrl = new URL(in);
InputStream ret = inUrl.openStream();
return (ret);