public NXComponent ftpReportConfig()
{
FTPClient client = new FTPClient();
try {
client.connect(((Session)session()).company().ftpURL());
if(client.login(((Session)session()).company().ftpAccountName(), ((Session)session()).company().ftpPassword())){
String filename = "Export-"+(new NSTimestamp())+".xls";
client.storeFile(filename, excelData().stream());
client.logout();
}else{
errorText = "Bad authentication";
return null;
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}