private static void borrarArchivoFTP() {
String pass = "000.000.000.000";//url
String filename = "/jasper4.pdf";
String user = "anonymous";
String server = "000.000.000.000";//url
FTPClient client = new FTPClient();
try {
client.connect(server);
client.login(user, pass);
// Delete file on the FTP server. When the FTP delete complete
// it returns true.
boolean deleted = client.deleteFile(filename);
if (deleted) {
System.out.println("File deleted...");
}
client.logout();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
String pass = "000.000.000.000";//url
String filename = "/jasper4.pdf";
String user = "anonymous";
String server = "000.000.000.000";//url
FTPClient client = new FTPClient();
try {
client.connect(server);
client.login(user, pass);
// Delete file on the FTP server. When the FTP delete complete
// it returns true.
boolean deleted = client.deleteFile(filename);
if (deleted) {
System.out.println("File deleted...");
}
client.logout();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}