I have the following problem. I am trying to bring a file over FTP using the api commons-net-3.5.
The code below works in eclipse perfectly within the server itself, but when it generates .jar the file does not come 0k.
FTPClient ftp = new FTPClient();
ftp.setConnectTimeout(1000000);
ftp.setDefaultTimeout(1000000);
ftp.connect("teste.com.br");
ftp.login("user", "senha");
ftp.changeWorkingDirectory ("/TESTE/TESTE/");
FileOutputStream fos = new FileOutputStream( pathToDownload );
ftp.setFileType(FTP.BINARY_FILE_TYPE);
ftp.enterLocalPassiveMode();
ftp.retrieveFile( "arquivo.scv", fos );
fos.close();
ftp.disconnect();
ftp = null;
What can it be? Thanks to all who can help.