/** * @param retries new value of retries to attempt * @return copy of this configuration with modified retries attempts. */ public OWLOntologyLoaderConfiguration setRetriesToAttempt(int retries) { // do not make copies if setting the same value if (getRetriesToAttempt() == retries) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(RETRIES_TO_ATTEMPT, Integer.valueOf(retries)); return copy; }
/** * @param retries new value of retries to attempt * @return copy of this configuration with modified retries attempts. */ public OWLOntologyLoaderConfiguration setRetriesToAttempt(int retries) { // do not make copies if setting the same value if (getRetriesToAttempt() == retries) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(RETRIES_TO_ATTEMPT, Integer.valueOf(retries)); return copy; }
/** * @param retries new value of retries to attempt * @return copy of this configuration with modified retries attempts. */ public OWLOntologyLoaderConfiguration setRetriesToAttempt(int retries) { // do not make copies if setting the same value if (getRetriesToAttempt() == retries) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(RETRIES_TO_ATTEMPT, Integer.valueOf(retries)); return copy; }
@Nullable protected static InputStream connectWithFiveRetries(IRI documentIRI, OWLOntologyLoaderConfiguration config, URLConnection conn, int connectionTimeout, String contentEncoding) throws IOException, OWLOntologyInputSourceException { InputStream is = null; int count = 0; while (count < config.getRetriesToAttempt() && is == null) { try { is = getInputStreamFromContentEncoding(conn, contentEncoding); } catch (SocketTimeoutException e) { count++; if (count == 5) { throw new OWLOntologyInputSourceException( "cannot connect to " + documentIRI + "; retry limit exhausted", e); } conn.setConnectTimeout(connectionTimeout + connectionTimeout * count); } } return is; }
@Nullable protected static InputStream connectWithFiveRetries(IRI documentIRI, OWLOntologyLoaderConfiguration config, URLConnection conn, int connectionTimeout, String contentEncoding) throws IOException, OWLOntologyInputSourceException { InputStream is = null; int count = 0; while (count < config.getRetriesToAttempt() && is == null) { try { is = getInputStreamFromContentEncoding(conn, contentEncoding); } catch (SocketTimeoutException e) { count++; if (count == 5) { throw new OWLOntologyInputSourceException( "cannot connect to " + documentIRI + "; retry limit exhausted", e); } conn.setConnectTimeout(connectionTimeout + connectionTimeout * count); } } return is; }
@Nullable protected static InputStream connectWithFiveRetries(IRI documentIRI, OWLOntologyLoaderConfiguration config, URLConnection conn, int connectionTimeout, String contentEncoding) throws IOException, OWLOntologyInputSourceException { InputStream is = null; int count = 0; while (count < config.getRetriesToAttempt() && is == null) { try { is = getInputStreamFromContentEncoding(conn, contentEncoding); } catch (SocketTimeoutException e) { count++; if (count == 5) { throw new OWLOntologyInputSourceException( "cannot connect to " + documentIRI + "; retry limit exhausted", e); } conn.setConnectTimeout(connectionTimeout + connectionTimeout * count); } } return is; }