For some reason, he does not see class method retrieveFile
public static boolean downloadFile(String Filename, String patch, FTPclient client) throws IOException{
try {
String remoteFile1 = Filename;
File downloadFile1=new File("E:/Dropbox/"+remoteFile1);
OutputStream outputStream1 = new BufferedOutputStream (new FileOutputStream (downloadFile1));
boolean success = client.retrieveFile(remoteFile1, outputStream1);
System.out.println(success);
outputStream1.close();
if (success == true) {
return true;
}
else System.out.println("False");
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
But if the code is placed in the "main" method the same class, the method is seen.
Code:
boolean success = client.retrieveFile(remoteFile1, outputStream1);
Error message (function "retrieveFile" not found):
Error:(99, 37) java: cannot find symbol
symbol: method retrieveFile(java.lang.String,java.io.OutputStream) location: variable client of type FTPclient