mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
added javadoc and made getRequestConfig protected
This commit is contained in:
@@ -9,12 +9,9 @@ package org.dspace.statistics.export.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
@@ -24,7 +21,6 @@ import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.tools.ant.taskdefs.condition.Http;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.statistics.export.OpenURLTracker;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -64,7 +60,9 @@ public class OpenUrlServiceImpl implements OpenUrlService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the response code from accessing the url
|
||||
* Returns the response code from accessing the url. Returns a http status 408 when the external service doesn't
|
||||
* reply in 10 seconds
|
||||
*
|
||||
* @param urlStr
|
||||
* @return response code from the url
|
||||
* @throws IOException
|
||||
@@ -77,7 +75,7 @@ public class OpenUrlServiceImpl implements OpenUrlService {
|
||||
return httpResponse.getStatusLine().getStatusCode();
|
||||
}
|
||||
|
||||
RequestConfig.Builder getRequestConfigBuilder(){
|
||||
protected RequestConfig.Builder getRequestConfigBuilder(){
|
||||
return RequestConfig.custom();
|
||||
}
|
||||
|
||||
|
@@ -143,7 +143,11 @@ public class OpenUrlServiceImplTest {
|
||||
|
||||
}
|
||||
|
||||
@Test()
|
||||
/**
|
||||
* Tests whether the timeout gets set to 10 seconds when processing a url
|
||||
* @throws SQLException
|
||||
*/
|
||||
@Test
|
||||
public void testTimeout() throws SQLException {
|
||||
Context context = mock(Context.class);
|
||||
String URL = "http://bla.com";
|
||||
|
Reference in New Issue
Block a user