1
|
package eu.dnetlib.data.collector.plugins.httpfilename;
|
2
|
|
3
|
import eu.dnetlib.data.collector.plugins.HttpConnector;
|
4
|
import eu.dnetlib.data.collector.rmi.CollectorServiceException;
|
5
|
|
6
|
|
7
|
/**
|
8
|
* Created by miriam on 07/05/2018.
|
9
|
*/
|
10
|
public class Connector extends HttpConnector implements ConnectorInterface {
|
11
|
private String response;
|
12
|
|
13
|
@Override
|
14
|
public void get(final String requestUrl) throws CollectorServiceException {
|
15
|
response = getInputSource(requestUrl);
|
16
|
}
|
17
|
|
18
|
@Override
|
19
|
public String getResponse() {
|
20
|
return response;
|
21
|
}
|
22
|
|
23
|
@Override
|
24
|
public boolean isStatusOk() {
|
25
|
return (response != null);
|
26
|
}
|
27
|
|
28
|
@Override
|
29
|
public boolean responseTypeContains(String string) {
|
30
|
String responseType = getResponseType();
|
31
|
if (responseType != null)
|
32
|
return responseType.contains(string);
|
33
|
return false;
|
34
|
}
|
35
|
|
36
|
|
37
|
}
|