public HttpInputSupplier newInputSupplier(URI uri, String requestMethod, String login, String password, @Nullable Integer connectTimeoutMillis,
@Nullable Integer readTimeoutMillis) {
- int read = readTimeoutMillis != null ? readTimeoutMillis : TIMEOUT_MILLISECONDS;
- int connect = connectTimeoutMillis != null ? connectTimeoutMillis : TIMEOUT_MILLISECONDS;
+ int read = readTimeoutMillis != null ? readTimeoutMillis : DEFAULT_READ_TIMEOUT_IN_MILLISECONDS;
+ int connect = connectTimeoutMillis != null ? connectTimeoutMillis : DEFAULT_CONNECT_TIMEOUT_IN_MILLISECONDS;
return new HttpInputSupplier(uri, requestMethod, userAgent, login, password, connect, read);
}
@ScannerSide
@ServerSide
public abstract class HttpDownloader extends UriReader.SchemeProcessor {
+
+ /**
+ * Catch-all default timeout, replaced by
+ * {@link #DEFAULT_READ_TIMEOUT_IN_MILLISECONDS}
+ * {@link #DEFAULT_CONNECT_TIMEOUT_IN_MILLISECONDS}
+ *
+ * @deprecated since 7.0
+ */
+ @Deprecated
public static final int TIMEOUT_MILLISECONDS = 20 * 1000;
+ /**
+ * @since 7.0
+ */
+ public static final int DEFAULT_READ_TIMEOUT_IN_MILLISECONDS = 60 * 1000;
+
+ /**
+ * @since 7.0
+ */
+ public static final int DEFAULT_CONNECT_TIMEOUT_IN_MILLISECONDS = 20 * 1000;
+
public abstract String downloadPlainText(URI uri, String encoding);
public abstract byte[] download(URI uri);