1
|
package eu.dnetlib.rmi.data;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
/**
|
6
|
* The DownloadPluin should retrieve the correct URL of the file to download
|
7
|
*/
|
8
|
public interface DownloadPlugin {
|
9
|
|
10
|
/**
|
11
|
* If Sets the base path, the plugin will start to download from the basePath in the file system
|
12
|
*
|
13
|
* @param basePath the base path
|
14
|
* @return the string
|
15
|
*/
|
16
|
void setBasePath(String basePath);
|
17
|
|
18
|
/**
|
19
|
* This method retrieve the correct Url of the file from the starting URL
|
20
|
*
|
21
|
* @param url the starting url
|
22
|
* @return the Url of the correct file
|
23
|
*/
|
24
|
DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
|
25
|
|
26
|
/**
|
27
|
* This method retrieve the correct Url of the file from a list of starting URL
|
28
|
*
|
29
|
* @param urls the list of starting url
|
30
|
* @return the list of the file URL
|
31
|
*/
|
32
|
Iterable<DownloadItem> retrieveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
|
33
|
|
34
|
/**
|
35
|
* Get the name of the plugin
|
36
|
*
|
37
|
* @return the name of the plugin
|
38
|
*/
|
39
|
String getPluginName();
|
40
|
|
41
|
/**
|
42
|
* Gets the regular expression.
|
43
|
*
|
44
|
* @return the regular expression
|
45
|
*/
|
46
|
List<String> getRegularExpression();
|
47
|
|
48
|
/**
|
49
|
* Sets the regular expression.
|
50
|
*
|
51
|
* @param regularExpression the new regular expression
|
52
|
*/
|
53
|
void setRegularExpression(final List<String> regularExpression);
|
54
|
|
55
|
}
|