1
|
package eu.dnetlib.data.collector.plugins;
|
2
|
|
3
|
import java.io.BufferedInputStream;
|
4
|
import java.io.FileInputStream;
|
5
|
import java.net.URL;
|
6
|
|
7
|
import eu.dnetlib.data.collector.rmi.CollectorServiceException;
|
8
|
|
9
|
public class FileCollectorPlugin extends AbstractSplittedRecordPlugin {
|
10
|
|
11
|
@Override
|
12
|
protected BufferedInputStream getBufferedInputStream(final String baseUrl) throws CollectorServiceException {
|
13
|
try {
|
14
|
return new BufferedInputStream(new FileInputStream(new URL(baseUrl).getPath()));
|
15
|
} catch (Exception e) {
|
16
|
throw new CollectorServiceException("Error reading file " + baseUrl, e);
|
17
|
}
|
18
|
}
|
19
|
|
20
|
}
|