1
|
package eu.dnetlib.data.collector.plugins;
|
2
|
|
3
|
import java.io.BufferedInputStream;
|
4
|
import java.io.FileInputStream;
|
5
|
import java.net.URL;
|
6
|
import java.util.zip.GZIPInputStream;
|
7
|
|
8
|
import eu.dnetlib.data.collector.rmi.CollectorServiceException;
|
9
|
|
10
|
public class FileGZipCollectorPlugin extends AbstractSplittedRecordPlugin {
|
11
|
|
12
|
@Override
|
13
|
protected BufferedInputStream getBufferedInputStream(final String baseUrl) throws CollectorServiceException {
|
14
|
|
15
|
try {
|
16
|
GZIPInputStream stream = new GZIPInputStream(new FileInputStream(new URL(baseUrl).getPath()));
|
17
|
return new BufferedInputStream(stream);
|
18
|
} catch (Exception e) {
|
19
|
throw new CollectorServiceException(e);
|
20
|
}
|
21
|
}
|
22
|
|
23
|
}
|