Open file when fetching task completed

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-10-25 10:54:52 +02:00
parent 2f6262789d
commit cfbb3ba560
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -43,6 +43,7 @@ public class FetchRemoteFileTask extends AsyncTask<Void, Void, String> {
private final String fileId; private final String fileId;
private final FileDataStorageManager storageManager; private final FileDataStorageManager storageManager;
private final FileDisplayActivity fileDisplayActivity; private final FileDisplayActivity fileDisplayActivity;
private OCFile ocFile;
public FetchRemoteFileTask(User user, public FetchRemoteFileTask(User user,
String fileId, String fileId,
@ -84,7 +85,7 @@ public class FetchRemoteFileTask extends AsyncTask<Void, Void, String> {
RemoteFile remoteFile = (RemoteFile) result.getData().get(0); RemoteFile remoteFile = (RemoteFile) result.getData().get(0);
OCFile ocFile = FileStorageUtils.fillOCFile(remoteFile); ocFile = FileStorageUtils.fillOCFile(remoteFile);
FileStorageUtils.searchForLocalFileInDefaultPath(ocFile, user.getAccountName()); FileStorageUtils.searchForLocalFileInDefaultPath(ocFile, user.getAccountName());
ocFile = storageManager.saveFileWithParent(ocFile, fileDisplayActivity); ocFile = storageManager.saveFileWithParent(ocFile, fileDisplayActivity);
@ -118,6 +119,6 @@ public class FetchRemoteFileTask extends AsyncTask<Void, Void, String> {
protected void onPostExecute(String message) { protected void onPostExecute(String message) {
super.onPostExecute(message); super.onPostExecute(message);
fileDisplayActivity.showFile(null, message); fileDisplayActivity.showFile(ocFile, message);
} }
} }