Search in sources :

Example 1 with DirectEditingOpenFileRemoteOperation

use of com.nextcloud.android.lib.resources.directediting.DirectEditingOpenFileRemoteOperation in project android by nextcloud.

the class TextEditorLoadUrlTask method doInBackground.

@Override
protected String doInBackground(Void... voids) {
    final EditorWebView editorWebView = editorWebViewWeakReference.get();
    if (editorWebView == null) {
        return "";
    }
    Editor editor = FileMenuFilter.getEditor(editorWebView.getContentResolver(), user, file.getMimeType());
    if (editor == null) {
        return "";
    }
    RemoteOperationResult result = new DirectEditingOpenFileRemoteOperation(file.getRemotePath(), editor.getId()).execute(account, editorWebViewWeakReference.get());
    if (!result.isSuccess()) {
        return "";
    }
    return (String) result.getData().get(0);
}
Also used : DirectEditingOpenFileRemoteOperation(com.nextcloud.android.lib.resources.directediting.DirectEditingOpenFileRemoteOperation) RemoteOperationResult(com.owncloud.android.lib.common.operations.RemoteOperationResult) Editor(com.owncloud.android.lib.common.Editor) EditorWebView(com.owncloud.android.ui.activity.EditorWebView)

Aggregations

DirectEditingOpenFileRemoteOperation (com.nextcloud.android.lib.resources.directediting.DirectEditingOpenFileRemoteOperation)1 Editor (com.owncloud.android.lib.common.Editor)1 RemoteOperationResult (com.owncloud.android.lib.common.operations.RemoteOperationResult)1 EditorWebView (com.owncloud.android.ui.activity.EditorWebView)1