gov.nasa.pds.report.logs.pushpull
Class PDSPullImpl
java.lang.Object
gov.nasa.pds.report.logs.pushpull.PDSPullImpl
- All Implemented Interfaces:
- PDSPull
public class PDSPullImpl
- extends Object
- implements PDSPull
Utility that provides all SFTP connection functionality
- Author:
- jpadams
Method Summary |
boolean |
connect(String hostname,
String username,
String password,
boolean encrypted)
Connects to external machine using SFTP. |
void |
disconnect()
Disconnect SFTP and the session |
void |
pull(String path,
String destination)
Retrieve the logs using the specified login information and host |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
session
protected com.jcraft.jsch.Session session
sftpChannel
protected com.jcraft.jsch.ChannelSftp sftpChannel
logDestBase
protected String logDestBase
PDSPullImpl
public PDSPullImpl()
connect
public boolean connect(String hostname,
String username,
String password,
boolean encrypted)
throws PushPullException
- Connects to external machine using SFTP. If encrypted, same encryption
as PBEEncryptor expected.
- Specified by:
connect
in interface PDSPull
- Parameters:
hostname
- username
- password
- password to external machineencrypted
- tells whether or not the password is encrypted
- Returns:
- whether or not the connection was successful
- Throws:
PushPullException
com.jcraft.jsch.JSchException
disconnect
public void disconnect()
- Disconnect SFTP and the session
- Specified by:
disconnect
in interface PDSPull
pull
public final void pull(String path,
String destination)
throws PushPullException
- Retrieve the logs using the specified login information and host
- Specified by:
pull
in interface PDSPull
- Throws:
PushPullException
Copyright © 2010–2015 Planetary Data System. All rights reserved.