java/automation/src/main/java/be/bosa/dt/best/automation/services/TransferService.java
/**
	 * Upload file to a server via SFTP
	 * 
	 * @param remote remote location of the file
	 * @param local local zip file
	 * @throws IOException 
	 */
Upload file to a server via SFTP

@param remote remote location of the file
@param local local zip file
@throws IOException
Upload file to a server via SFTP @param remote remote location of the file @param local local zip file @throws IOException
@Retry(retryOn = Exception.class, maxRetries = 5, delay = 3000)
	public void upload(String remote, String local) throws IOException {
		SSHClient client = new SSHClient();
		client.addHostKeyVerifier(new PromiscuousVerifier());
		client.connect(dataServer, dataPort);
		client.authPassword(dataUser, dataPass);
		try (SFTPClient sftp = client.newSFTPClient()) {
			sftp.put(local, remote);
		} finally {
			client.disconnect();
		}		
	}
@ Retry ( retryOn = Exception . class , maxRetries = 5 , delay = 3000 ) public void upload ( String remote , String local ) throws IOException { SSHClient client = new SSHClient ( ) ; client . addHostKeyVerifier ( new PromiscuousVerifier ( ) ) ; client . connect ( dataServer , dataPort ) ; client . authPassword ( dataUser , dataPass ) ; try ( SFTPClient sftp = client . newSFTPClient ( ) ) { sftp . put ( local , remote ) ; } finally { client . disconnect ( ) ; } }
Upload file to a server via SFTP
Upload file to a server via SFTP