~xdavidwu/saf-sftp

b4264a04f2a8e83a0b8b402c4a93b780aea9eb30 — xdavidwu 5 years ago 099aec4
ReadTask: always try to close the file
1 files changed, 6 insertions(+), 1 deletions(-)

M src/main/java/org/safsftp/ReadTask.java
M src/main/java/org/safsftp/ReadTask.java => src/main/java/org/safsftp/ReadTask.java +6 -1
@@ 33,12 33,17 @@ public class ReadTask extends AsyncTask<Void,Void,Void> {
				acos.write(buf,0,size);
				offset+=size;
			}
			sftp.closeFile(file);
			acos.close();
		}
		catch(Exception e){
			Log.e("SFTP","read file "+e.toString());
		}
		try{
			sftp.closeFile(file);
		}
		catch(Exception e){
			Log.e("SFTP","close file "+e.toString());
		}
		return null;
	}
}