Pessoal,
como faço para obter o resultado do comando "mls"?
o codigo basico do programa que estou trabalhando é:
FTPClient client = new FTPClient();
client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
try {
client.connect(server);
client.login("anonymous", "[email removido]");
client.setBufferSize(32 * 1024 * 1024); // 32Mb
client.setTcpNoDelay(true);
client.enterRemotePassiveMode();
client.enterLocalActiveMode();
client.changeWorkingDirectory(path);
int ret = client.sendCommand("mls");
} catch (SocketException ex) {
Logger.getLogger(FtpUtils.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(FtpUtils.class.getName()).log(Level.SEVERE, null, ex);
} finally {
if (client != null) {
if (client.isConnected()) {
try {
client.logout();
client.disconnect();
} catch (Exception e) {
}
}
}
}
Valeu.