ftp4j

Recursively list files and directories in an FTP server using Java

你离开我真会死。 提交于 2021-02-08 08:35:39
问题 I'm currently using a Java FTP library (ftp4j) to access a FTP server. I want to do a file count and directory count for the server, but this means I would need to list files within directories within directories within directories, etc. How is this achievable? Any hints would be greatly appreciated. Extract from the code: client = new FTPClient(); try { client.connect(""); client.login("", ""); client.changeDirectory("/"); FTPFile[] list = client.list(); int totalDIRS = 0; int totalFILES = 0

Result of .renameTo() is ignored

十年热恋 提交于 2019-12-11 12:39:29
问题 I am trying to upload a file via FTP, but before it is uploaded it has to be renamed to the input of 2 editText's. To do this i use the following code: public FTPClient client = new FTPClient(); public void upload_klik (View view) { EditText week_text = (EditText) findViewById(R.id.week_edit); EditText pagina_text = (EditText) findViewById(R.id.pagina_edit); String w_val = week_text.getText().toString(); String p_val = pagina_text.getText().toString(); upload_task up = new upload_task(); up