S
Schnicke
Neues Mitglied
- 0
Hallo zusammen,
ich bin am verzweifeln. Ich möchte eine Textdatei von einem FTP-Server runterladen. Hier der Code:
Bis vor
läuft das Programm. Der FileOutputStream wird nicht mehr erstellt. Fehlermeldung:
Was ist hier falsch? Ich freue mich über jede Hilfe
ich bin am verzweifeln. Ich möchte eine Textdatei von einem FTP-Server runterladen. Hier der Code:
Code:
public class UpDown extends Activity{
...
class Download extends AsyncTask<String, Void, String> {
...
private String connect() {
// Verbinden und einloggen
...
// Da kommts her...
String srcPath = "/Ordner/Unterordner/Textdatei.txt";
// ... und da solls hin
String destPath = Environment.getExternalStorageDirectory()
.toString() + "/Datei";
if (ftpDownload(srcPath, destPath)) {
Log.d(TAG, "download done");
}
} catch (Exception e) {
e.printStackTrace();
}
if (ftpDisconnect()) {
Log.d(TAG, "disconnected");
}
return "placeholder";
}
}
public boolean ftpDownload(String srcFilePath, String desFilePath) {
boolean status = false;
try {
FileOutputStream desFileStream = new FileOutputStream(desFilePath);
status = ftpClient.retrieveFile(srcFilePath, desFileStream);
desFileStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
Log.d(TAG, "download failed");
}
return status;
}
}
Code:
FileOutputStream desFileStream = new FileOutputStream(desFilePath);
Code:
05-23 15:14:01.867: W/System.err(18884):
java.io.FileNotFoundException: /storage/emulated/0/Datei:
open failed: EISDIR (Is a directory)
Was ist hier falsch? Ich freue mich über jede Hilfe