1
|
package eu.dnetlib.data.download.rmi;
|
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
|
*/
|
15
|
void setBasePath(String basePath);
|
16
|
|
17
|
/**
|
18
|
* This method retrieve the correct Url of the file from the starting URL
|
19
|
*
|
20
|
* @param item the starting url
|
21
|
* @return the Url of the correct file
|
22
|
*/
|
23
|
DownloadItem retrieveUrl(DownloadItem item) throws DownloadPluginException;
|
24
|
|
25
|
/**
|
26
|
* This method retrieve the correct Url of the file from a list of starting URL
|
27
|
*
|
28
|
* @param items the list of starting url
|
29
|
* @return the list of the file URL
|
30
|
*/
|
31
|
Iterable<DownloadItem> retrieveUrls(Iterable<DownloadItem> items) throws DownloadPluginException;
|
32
|
|
33
|
/**
|
34
|
* Get the name of the plugin
|
35
|
*
|
36
|
* @return the name of the plugin
|
37
|
*/
|
38
|
String getPluginName();
|
39
|
|
40
|
/**
|
41
|
* Gets the regular expression.
|
42
|
*
|
43
|
* @return the regular expression
|
44
|
*/
|
45
|
List<String> getRegularExpression();
|
46
|
|
47
|
/**
|
48
|
* Sets the regular expression.
|
49
|
*
|
50
|
* @param regularExpression the new regular expression
|
51
|
*/
|
52
|
void setRegularExpression(final List<String> regularExpression);
|
53
|
|
54
|
}
|