Search in sources :

Example 1 with Nullable

use of jgnash.util.Nullable in project jgnash by ccavanaugh.

the class ConnectionFactory method openConnection.

@Nullable
private static synchronized URLConnection openConnection(final URL url) {
    URLConnection connection = null;
    try {
        connection = url.openConnection();
    } catch (final IOException ex) {
        logSevere(ConnectionFactory.class, ex);
    }
    /* Set the connection timeout */
    if (connection != null) {
        connection.setConnectTimeout(getConnectionTimeout() * 1000);
        connection.setReadTimeout(getConnectionTimeout() * 1000);
    }
    return connection;
}
Also used : IOException(java.io.IOException) URLConnection(java.net.URLConnection) Nullable(jgnash.util.Nullable)

Aggregations

IOException (java.io.IOException)1 URLConnection (java.net.URLConnection)1 Nullable (jgnash.util.Nullable)1