@@ -132,6 +132,11 @@ private CompletableFuture<Resource> downloadFrom(final URL url) {
132132 }
133133
134134 private Resource tryDownloading (final URL downloadFrom ) throws IOException {
135+ try {
136+ final int httpsRequestInterval = getTimeValue (ConfigurationConstants .KEY_HTTPCONNECTION_REQUEST_INTERVAL );
137+ Thread .sleep (httpsRequestInterval );
138+ } catch (InterruptedException ie ) {
139+ }
135140 DownloadDetails downloadDetails = null ;
136141 try (final CloseableConnection connection = getDownloadConnection (downloadFrom )) {
137142 downloadDetails = getDownloadDetails (connection );
@@ -161,20 +166,20 @@ private Resource tryDownloading(final URL downloadFrom) throws IOException {
161166 private CloseableConnection getDownloadConnection (final URL location ) throws IOException {
162167 final Map <String , String > requestProperties = new HashMap <>();
163168 requestProperties .put (ACCEPT_ENCODING_HEADER , PACK_200_OR_GZIP );
164- return ConnectionFactory .openConnection (location , HttpMethod .GET , requestProperties , getTimeoutValue (ConfigurationConstants .KEY_HTTPCONNECTION_CONNECT_TIMEOUT ), getTimeoutValue (ConfigurationConstants .KEY_HTTPCONNECTION_READ_TIMEOUT ));
169+ return ConnectionFactory .openConnection (location , HttpMethod .GET , requestProperties , getTimeValue (ConfigurationConstants .KEY_HTTPCONNECTION_CONNECT_TIMEOUT ), getTimeValue (ConfigurationConstants .KEY_HTTPCONNECTION_READ_TIMEOUT ));
165170 }
166171
167- private int getTimeoutValue (final String key ) {
168- int timeout = 0 ;
172+ private int getTimeValue (final String key ) {
173+ int timeValue = 0 ;
169174 final String value = JNLPRuntime .getConfiguration ().getProperty (key );
170175 if (value != null && value .trim ().length () != 0 ) {
171176 try {
172- timeout = Integer .valueOf (value );
177+ timeValue = Integer .valueOf (value );
173178 } catch (NumberFormatException e ) {
174179 LOG .error ("Could not parse {} with value '{}' - reason {}" , key , value , e .getMessage ());
175180 }
176181 }
177- return timeout ;
182+ return timeValue ;
178183 }
179184
180185 private long tryDownloading (final DownloadDetails downloadDetails ) throws IOException {
0 commit comments