안드로이드 개발 질문/답변
(글 수 45,052)
NetComponents를 사용해서 FTP 구현을 하려고 하는 초보 개발자 입니다.
디렉토리 생성, 파일 삭제 이런것은 잘 되는데요..
파일 다운, 파일 업로드, 리스드 목록 받아 오기가 안되네요.ㅜㅜ
public File getFileDownLoad(String downPath, String downFile) {
/**
*
* retriveFile(String remoteName, OutputStream local)
* |
* storeFile(String remoteName, InputStream local)
*/
// String path =
File downloadFile = new File(downPath+""+downFile);
FileOutputStream fos = null;
//InputStream inputS =null;
try {
fos = new FileOutputStream(downloadFile);
boolean isSuccess = ftpClient.retrieveFile(downloadFile.getName(), fos);
if (isSuccess) {
//inputS = ftpClient.retrieveFileStream(downloadFile.getName());
Log.i("YESNO","DOWNLOAD_SUCCES");
System.out.println("다운로드 성공");
}else {
Log.i("YESNO","DOWNLOAD_FAIL");
System.out.println("다운로드 실패");
}
}
catch(IOException ex) {
System.out.println(ex.getMessage());
Log.i("Exception", ex.getMessage());
} finally {
if ( fos != null)
try {
fos.close();
}
catch(IOException ex) {}
}
return null;
}
이부분이 파일 다운로드 함수인데요..
무엇이 문제 일까요>ㅜㅜ
도움 부탁 드립니다.
디렉토리 생성, 파일 삭제 이런것은 잘 되는데요..
파일 다운, 파일 업로드, 리스드 목록 받아 오기가 안되네요.ㅜㅜ
public File getFileDownLoad(String downPath, String downFile) {
/**
*
* retriveFile(String remoteName, OutputStream local)
* |
* storeFile(String remoteName, InputStream local)
*/
// String path =
File downloadFile = new File(downPath+""+downFile);
FileOutputStream fos = null;
//InputStream inputS =null;
try {
fos = new FileOutputStream(downloadFile);
boolean isSuccess = ftpClient.retrieveFile(downloadFile.getName(), fos);
if (isSuccess) {
//inputS = ftpClient.retrieveFileStream(downloadFile.getName());
Log.i("YESNO","DOWNLOAD_SUCCES");
System.out.println("다운로드 성공");
}else {
Log.i("YESNO","DOWNLOAD_FAIL");
System.out.println("다운로드 실패");
}
}
catch(IOException ex) {
System.out.println(ex.getMessage());
Log.i("Exception", ex.getMessage());
} finally {
if ( fos != null)
try {
fos.close();
}
catch(IOException ex) {}
}
return null;
}
이부분이 파일 다운로드 함수인데요..
무엇이 문제 일까요>ㅜㅜ
도움 부탁 드립니다.
저랑 똑같은 현상이네요...
혹시 해결하셨는지요,.??