}
public static boolean uploadToServer(String collectionFilePath, String host, String username, String password) throws Exception {
attemptConnect(host, username, password);
SSHTools ssh = new SSHTools(username, null);
SFTPSession sftp = null;
HostAndPort hostAndPort = HostAndPort.fromString(host);
if (hostAndPort.hasPort()) {
sftp = ssh.getSftpSession(username, password, null, hostAndPort.getHostText(), hostAndPort.getPort(), null);
}
else {
sftp = ssh.getSftpSession(username, password, null, host, null);
}
String rootpath = sftp.exec("pwd").trim();
HashMap<File, File> files = new HashMap<File, File>();