Revision 28806
Added by Sandro La Bruzzo almost 10 years ago
FilesystemCollectorPlugin.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.collector.plugins.filesystem; |
2 | 2 |
|
3 |
import java.net.URISyntaxException; |
|
4 |
|
|
5 |
import org.apache.commons.logging.Log; |
|
6 |
import org.apache.commons.logging.LogFactory; |
|
7 |
|
|
8 | 3 |
import eu.dnetlib.data.collector.plugin.CollectorPlugin; |
9 | 4 |
import eu.dnetlib.data.collector.rmi.CollectorServiceException; |
10 | 5 |
import eu.dnetlib.data.collector.rmi.InterfaceDescriptor; |
... | ... | |
16 | 11 |
*/ |
17 | 12 |
public class FilesystemCollectorPlugin implements CollectorPlugin { |
18 | 13 |
|
19 |
private static final Log log = LogFactory.getLog(FilesystemCollectorPlugin.class); |
|
20 |
|
|
21 | 14 |
@Override |
22 |
public Iterable<String> collect(final InterfaceDescriptor interfaceDescriptor, final String fromDate, final String untilDate) throws CollectorServiceException { |
|
15 |
public Iterable<String> collect(final InterfaceDescriptor interfaceDescriptor, final String fromDate, final String untilDate) |
|
16 |
throws CollectorServiceException { |
|
23 | 17 |
|
24 | 18 |
final String baseUrl = interfaceDescriptor.getBaseUrl(); |
25 |
|
|
26 | 19 |
if ((baseUrl == null) || baseUrl.isEmpty()) throw new CollectorServiceException("Param 'baseurl' is null or empty"); |
20 |
return new FilesystemIterable(interfaceDescriptor); |
|
27 | 21 |
|
28 |
try { |
|
29 |
return new FilesystemIterable(interfaceDescriptor); |
|
30 |
} catch (URISyntaxException e) { |
|
31 |
log.error("Filesystem collector failed! ", e); |
|
32 |
return null; |
|
33 |
} |
|
34 | 22 |
} |
35 | 23 |
|
36 | 24 |
@Override |
Also available in: Unified diff
Implemented a new version of the collector plugin for the File system