Project

General

Profile

1
package eu.dnetlib.data.collector.plugins.sftp;
2

    
3
import java.util.Set;
4

    
5
import eu.dnetlib.rmi.data.CollectorServiceException;
6
import eu.dnetlib.rmi.data.InterfaceDescriptor;
7
import org.springframework.beans.factory.annotation.Value;
8

    
9
/**
10
 * Created by alessia on 15/03/17.
11
 */
12
public class SftpPubKeyCollectorPlugin extends AbstractSftpCollectorPlugin {
13

    
14
	@Value("${collector.sftp.auth.prvKeyPath}")
15
	private String prvKeyFilePath;
16
	@Value("${collector.sftp.auth.passphrase}")
17
	private String passphrase;
18
	@Value("${collector.sftp.auth.knownHostsPath}")
19
	private String knownHostsFile;
20

    
21
	@Override
22
	protected Iterable<String> getIterable(final InterfaceDescriptor interfaceDescriptor,
23
			final String baseUrl,
24
			final boolean isRecursive,
25
			final Set<String> extensionSet,
26
			final String fromDate) throws CollectorServiceException {
27

    
28
		return () -> getSftpIteratorFactory().newIteratorPubKeyAuth(baseUrl, prvKeyFilePath, passphrase, knownHostsFile, isRecursive, extensionSet, fromDate);
29
	}
30

    
31
}
(5-5/5)