@Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result = null; /// download will be performed to a temporal file, then moved to the final location File tmpFile = new File(getTmpPath()); /// perform the download try { tmpFile.getParentFile().mkdirs(); int status = downloadFile(client, tmpFile); result = new RemoteOperationResult(isSuccess(status), mGet); Log_OC.i(TAG, "Download of " + mRemotePath + " to " + getTmpPath() + ": " + result.getLogMessage()); } catch (Exception e) { result = new RemoteOperationResult(e); Log_OC.e(TAG, "Download of " + mRemotePath + " to " + getTmpPath() + ": " + result.getLogMessage(), e); } return result; }
try { status = client.executeMethod(mGet); if (isSuccess(status)) { targetFile.createNewFile(); BufferedInputStream bis = new BufferedInputStream(mGet.getResponseBodyAsStream());