Search in sources :

Example 41 with DocumentFile

use of androidx.documentfile.provider.DocumentFile in project AmazeFileManager by TeamAmaze.

the class HybridFile method getInputStream.

@Nullable
public InputStream getInputStream(Context context) {
    InputStream inputStream;
    switch(mode) {
        case SFTP:
            inputStream = SshClientUtils.execute(new SFtpClientTemplate<InputStream>(path, false) {

                @Override
                public InputStream execute(final SFTPClient client) throws IOException {
                    final RemoteFile rf = client.open(SshClientUtils.extractRemotePathFrom(path));
                    return rf.new RemoteFileInputStream() {

                        @Override
                        public void close() throws IOException {
                            try {
                                super.close();
                            } finally {
                                rf.close();
                                client.close();
                            }
                        }
                    };
                }
            });
            break;
        case SMB:
            try {
                inputStream = getSmbFile().getInputStream();
            } catch (IOException e) {
                inputStream = null;
                e.printStackTrace();
            }
            break;
        case DOCUMENT_FILE:
            ContentResolver contentResolver = context.getContentResolver();
            DocumentFile documentSourceFile = getDocumentFile(false);
            try {
                inputStream = contentResolver.openInputStream(documentSourceFile.getUri());
            } catch (FileNotFoundException e) {
                e.printStackTrace();
                inputStream = null;
            }
            break;
        case OTG:
            contentResolver = context.getContentResolver();
            documentSourceFile = OTGUtil.getDocumentFile(path, context, false);
            try {
                inputStream = contentResolver.openInputStream(documentSourceFile.getUri());
            } catch (FileNotFoundException e) {
                e.printStackTrace();
                inputStream = null;
            }
            break;
        case DROPBOX:
            CloudStorage cloudStorageDropbox = dataUtils.getAccount(OpenMode.DROPBOX);
            Log.d(getClass().getSimpleName(), CloudUtil.stripPath(OpenMode.DROPBOX, path));
            inputStream = cloudStorageDropbox.download(CloudUtil.stripPath(OpenMode.DROPBOX, path));
            break;
        case BOX:
            CloudStorage cloudStorageBox = dataUtils.getAccount(OpenMode.BOX);
            inputStream = cloudStorageBox.download(CloudUtil.stripPath(OpenMode.BOX, path));
            break;
        case GDRIVE:
            CloudStorage cloudStorageGDrive = dataUtils.getAccount(OpenMode.GDRIVE);
            inputStream = cloudStorageGDrive.download(CloudUtil.stripPath(OpenMode.GDRIVE, path));
            break;
        case ONEDRIVE:
            CloudStorage cloudStorageOneDrive = dataUtils.getAccount(OpenMode.ONEDRIVE);
            inputStream = cloudStorageOneDrive.download(CloudUtil.stripPath(OpenMode.ONEDRIVE, path));
            break;
        default:
            try {
                inputStream = new FileInputStream(path);
            } catch (FileNotFoundException e) {
                inputStream = null;
                e.printStackTrace();
            }
            break;
    }
    return inputStream;
}
Also used : CloudStorage(com.cloudrail.si.interfaces.CloudStorage) SFtpClientTemplate(com.amaze.filemanager.filesystem.ssh.SFtpClientTemplate) DocumentFile(androidx.documentfile.provider.DocumentFile) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) FileNotFoundException(java.io.FileNotFoundException) SFTPClient(net.schmizz.sshj.sftp.SFTPClient) IOException(java.io.IOException) RemoteFile(net.schmizz.sshj.sftp.RemoteFile) FileInputStream(java.io.FileInputStream) ContentResolver(android.content.ContentResolver) Nullable(androidx.annotation.Nullable)

Example 42 with DocumentFile

use of androidx.documentfile.provider.DocumentFile in project AmazeFileManager by TeamAmaze.

the class HybridFile method getOutputStream.

@Nullable
public OutputStream getOutputStream(Context context) {
    OutputStream outputStream;
    switch(mode) {
        case SFTP:
            return SshClientUtils.execute(new SshClientTemplate<OutputStream>(path, false) {

                @Override
                public OutputStream execute(final SSHClient ssh) throws IOException {
                    final SFTPClient client = ssh.newSFTPClient();
                    final RemoteFile rf = client.open(SshClientUtils.extractRemotePathFrom(path), EnumSet.of(net.schmizz.sshj.sftp.OpenMode.WRITE, net.schmizz.sshj.sftp.OpenMode.CREAT));
                    return rf.new RemoteFileOutputStream() {

                        @Override
                        public void close() throws IOException {
                            try {
                                super.close();
                            } finally {
                                try {
                                    rf.close();
                                    client.close();
                                } catch (Exception e) {
                                    Log.w(TAG, "Error closing stream", e);
                                }
                            }
                        }
                    };
                }
            });
        case SMB:
            try {
                outputStream = getSmbFile().getOutputStream();
            } catch (IOException e) {
                outputStream = null;
                e.printStackTrace();
            }
            break;
        case DOCUMENT_FILE:
            ContentResolver contentResolver = context.getContentResolver();
            DocumentFile documentSourceFile = getDocumentFile(true);
            try {
                outputStream = contentResolver.openOutputStream(documentSourceFile.getUri());
            } catch (FileNotFoundException e) {
                e.printStackTrace();
                outputStream = null;
            }
            break;
        case OTG:
            contentResolver = context.getContentResolver();
            documentSourceFile = OTGUtil.getDocumentFile(path, context, true);
            try {
                outputStream = contentResolver.openOutputStream(documentSourceFile.getUri());
            } catch (FileNotFoundException e) {
                e.printStackTrace();
                outputStream = null;
            }
            break;
        default:
            try {
                outputStream = FileUtil.getOutputStream(getFile(), context);
            } catch (Exception e) {
                outputStream = null;
                e.printStackTrace();
            }
    }
    return outputStream;
}
Also used : DocumentFile(androidx.documentfile.provider.DocumentFile) OutputStream(java.io.OutputStream) FileNotFoundException(java.io.FileNotFoundException) SSHClient(net.schmizz.sshj.SSHClient) SFTPClient(net.schmizz.sshj.sftp.SFTPClient) IOException(java.io.IOException) RemoteFile(net.schmizz.sshj.sftp.RemoteFile) SmbException(jcifs.smb.SmbException) FileNotFoundException(java.io.FileNotFoundException) SFTPException(net.schmizz.sshj.sftp.SFTPException) ShellNotRunningException(com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) CloudPluginException(com.amaze.filemanager.file_operations.exceptions.CloudPluginException) ContentResolver(android.content.ContentResolver) Nullable(androidx.annotation.Nullable)

Example 43 with DocumentFile

use of androidx.documentfile.provider.DocumentFile in project AmazeFileManager by TeamAmaze.

the class FileUtils method scanFile.

/**
 * Triggers media store for the file path
 *
 * @param hybridFile the file which was changed (directory not supported)
 * @param context given context
 */
private static void scanFile(@NonNull HybridFile hybridFile, Context context) {
    if ((hybridFile.isLocal() || hybridFile.isOtgFile()) && hybridFile.exists(context)) {
        Uri uri = null;
        if (Build.VERSION.SDK_INT >= 19) {
            DocumentFile documentFile = ExternalSdCardOperation.getDocumentFile(hybridFile.getFile(), hybridFile.isDirectory(context), context);
            // If FileUtil.getDocumentFile() returns null, fall back to DocumentFile.fromFile()
            if (documentFile == null)
                documentFile = DocumentFile.fromFile(hybridFile.getFile());
            uri = documentFile.getUri();
        } else {
            if (hybridFile.isLocal()) {
                uri = Uri.fromFile(hybridFile.getFile());
            }
        }
        if (uri != null) {
            FileUtils.scanFile(uri, context);
        }
    }
}
Also used : DocumentFile(androidx.documentfile.provider.DocumentFile) Uri(android.net.Uri)

Example 44 with DocumentFile

use of androidx.documentfile.provider.DocumentFile in project AmazeFileManager by TeamAmaze.

the class Operations method mkdir.

public static void mkdir(final HybridFile parentFile, @NonNull final HybridFile file, final Context context, final boolean rootMode, @NonNull final ErrorCallBack errorCallBack) {
    new AsyncTask<Void, Void, Void>() {

        private DataUtils dataUtils = DataUtils.getInstance();

        private Function<DocumentFile, Void> safCreateDirectory = input -> {
            if (input != null && input.isDirectory()) {
                boolean result = false;
                try {
                    result = input.createDirectory(file.getName(context)) != null;
                } catch (Exception e) {
                    Log.w(getClass().getSimpleName(), "Failed to make directory", e);
                }
                errorCallBack.done(file, result);
            } else
                errorCallBack.done(file, false);
            return null;
        };

        @Override
        protected Void doInBackground(Void... params) {
            // checking whether filename is valid or a recursive call possible
            if (!Operations.isFileNameValid(file.getName(context))) {
                errorCallBack.invalidName(file);
                return null;
            }
            if (file.exists()) {
                errorCallBack.exists(file);
                return null;
            }
            if (file.isSftp()) {
                file.mkdir(context);
                return null;
            }
            if (file.isSmb()) {
                try {
                    file.getSmbFile(2000).mkdirs();
                } catch (SmbException e) {
                    e.printStackTrace();
                    errorCallBack.done(file, false);
                    return null;
                }
                errorCallBack.done(file, file.exists());
                return null;
            } else if (file.isOtgFile()) {
                if (checkOtgNewFileExists(file, context)) {
                    errorCallBack.exists(file);
                    return null;
                }
                safCreateDirectory.apply(OTGUtil.getDocumentFile(parentFile.getPath(), context, false));
                return null;
            } else if (file.isDocumentFile()) {
                if (checkDocumentFileNewFileExists(file, context)) {
                    errorCallBack.exists(file);
                    return null;
                }
                safCreateDirectory.apply(OTGUtil.getDocumentFile(parentFile.getPath(), SafRootHolder.getUriRoot(), context, OpenMode.DOCUMENT_FILE, false));
                return null;
            } else if (file.isDropBoxFile()) {
                CloudStorage cloudStorageDropbox = dataUtils.getAccount(OpenMode.DROPBOX);
                try {
                    cloudStorageDropbox.createFolder(CloudUtil.stripPath(OpenMode.DROPBOX, file.getPath()));
                    errorCallBack.done(file, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(file, false);
                }
            } else if (file.isBoxFile()) {
                CloudStorage cloudStorageBox = dataUtils.getAccount(OpenMode.BOX);
                try {
                    cloudStorageBox.createFolder(CloudUtil.stripPath(OpenMode.BOX, file.getPath()));
                    errorCallBack.done(file, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(file, false);
                }
            } else if (file.isOneDriveFile()) {
                CloudStorage cloudStorageOneDrive = dataUtils.getAccount(OpenMode.ONEDRIVE);
                try {
                    cloudStorageOneDrive.createFolder(CloudUtil.stripPath(OpenMode.ONEDRIVE, file.getPath()));
                    errorCallBack.done(file, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(file, false);
                }
            } else if (file.isGoogleDriveFile()) {
                CloudStorage cloudStorageGdrive = dataUtils.getAccount(OpenMode.GDRIVE);
                try {
                    cloudStorageGdrive.createFolder(CloudUtil.stripPath(OpenMode.GDRIVE, file.getPath()));
                    errorCallBack.done(file, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(file, false);
                }
            } else {
                if (file.isLocal() || file.isRoot()) {
                    int mode = checkFolder(new File(file.getParent(context)), context);
                    if (mode == 2) {
                        errorCallBack.launchSAF(file);
                        return null;
                    }
                    if (mode == 1 || mode == 0)
                        MakeDirectoryOperation.mkdir(file.getFile(), context);
                    if (!file.exists() && rootMode) {
                        file.setMode(OpenMode.ROOT);
                        if (file.exists())
                            errorCallBack.exists(file);
                        try {
                            MakeDirectoryCommand.INSTANCE.makeDirectory(file.getParent(context), file.getName(context));
                        } catch (ShellNotRunningException e) {
                            e.printStackTrace();
                        }
                        errorCallBack.done(file, file.exists());
                        return null;
                    }
                    errorCallBack.done(file, file.exists());
                    return null;
                }
                errorCallBack.done(file, file.exists());
            }
            return null;
        }
    }.executeOnExecutor(executor);
}
Also used : Context(android.content.Context) CloudStorage(com.cloudrail.si.interfaces.CloudStorage) URL(java.net.URL) MakeDirectoryCommand(com.amaze.filemanager.filesystem.root.MakeDirectoryCommand) NonNull(androidx.annotation.NonNull) MakeFileCommand(com.amaze.filemanager.filesystem.root.MakeFileCommand) Intent(android.content.Intent) SmbException(jcifs.smb.SmbException) OpenMode(com.amaze.filemanager.file_operations.filesystem.OpenMode) CloudUtil(com.amaze.filemanager.filesystem.cloud.CloudUtil) TAG_INTENT_FILTER_GENERAL(com.amaze.filemanager.ui.activities.MainActivity.TAG_INTENT_FILTER_GENERAL) ArrayList(java.util.ArrayList) ByteArrayInputStream(java.io.ByteArrayInputStream) SshClientUtils(com.amaze.filemanager.filesystem.ssh.SshClientUtils) ShellNotRunningException(com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException) DataUtils(com.amaze.filemanager.utils.DataUtils) SFTPClient(net.schmizz.sshj.sftp.SFTPClient) Build(android.os.Build) Function(androidx.arch.core.util.Function) TAG_INTENT_FILTER_FAILED_OPS(com.amaze.filemanager.ui.activities.MainActivity.TAG_INTENT_FILTER_FAILED_OPS) Log(android.util.Log) OutputStream(java.io.OutputStream) MalformedURLException(java.net.MalformedURLException) Executor(java.util.concurrent.Executor) OTGUtil(com.amaze.filemanager.utils.OTGUtil) AsyncTask(android.os.AsyncTask) IOException(java.io.IOException) TextUtils(android.text.TextUtils) FileUtils(com.amaze.filemanager.filesystem.files.FileUtils) File(java.io.File) SmbFile(jcifs.smb.SmbFile) DocumentFile(androidx.documentfile.provider.DocumentFile) RenameFileCommand(com.amaze.filemanager.filesystem.root.RenameFileCommand) R(com.amaze.filemanager.R) SFtpClientTemplate(com.amaze.filemanager.filesystem.ssh.SFtpClientTemplate) SmbException(jcifs.smb.SmbException) CloudStorage(com.cloudrail.si.interfaces.CloudStorage) DocumentFile(androidx.documentfile.provider.DocumentFile) ShellNotRunningException(com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException) DataUtils(com.amaze.filemanager.utils.DataUtils) File(java.io.File) SmbFile(jcifs.smb.SmbFile) DocumentFile(androidx.documentfile.provider.DocumentFile) SmbException(jcifs.smb.SmbException) ShellNotRunningException(com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException)

Example 45 with DocumentFile

use of androidx.documentfile.provider.DocumentFile in project AmazeFileManager by TeamAmaze.

the class Operations method rename.

public static void rename(@NonNull final HybridFile oldFile, @NonNull final HybridFile newFile, final boolean rootMode, @NonNull final Context context, @NonNull final ErrorCallBack errorCallBack) {
    new AsyncTask<Void, Void, Void>() {

        private final DataUtils dataUtils = DataUtils.getInstance();

        private Function<DocumentFile, Void> safRenameFile = input -> {
            boolean result = false;
            try {
                result = input.renameTo(newFile.getName(context));
            } catch (Exception e) {
                Log.w(getClass().getSimpleName(), "Failed to rename", e);
            }
            errorCallBack.done(newFile, result);
            return null;
        };

        @Override
        protected Void doInBackground(Void... params) {
            // If rename is on OTG, we are skipping
            if (!Operations.isFileNameValid(newFile.getName(context))) {
                errorCallBack.invalidName(newFile);
                return null;
            }
            if (newFile.exists()) {
                errorCallBack.exists(newFile);
                return null;
            }
            if (oldFile.isSmb()) {
                try {
                    SmbFile smbFile = oldFile.getSmbFile();
                    // FIXME: smbFile1 should be created from SmbUtil too so it can be mocked
                    SmbFile smbFile1 = new SmbFile(new URL(newFile.getPath()), smbFile.getContext());
                    if (newFile.exists()) {
                        errorCallBack.exists(newFile);
                        return null;
                    }
                    smbFile.renameTo(smbFile1);
                    if (!smbFile.exists() && smbFile1.exists())
                        errorCallBack.done(newFile, true);
                } catch (SmbException | MalformedURLException e) {
                    String errmsg = context.getString(R.string.cannot_rename_file, HybridFile.parseAndFormatUriForDisplay(oldFile.getPath()), e.getMessage());
                    try {
                        ArrayList<HybridFileParcelable> failedOps = new ArrayList<>();
                        failedOps.add(new HybridFileParcelable(oldFile.getSmbFile()));
                        context.sendBroadcast(new Intent(TAG_INTENT_FILTER_GENERAL).putParcelableArrayListExtra(TAG_INTENT_FILTER_FAILED_OPS, failedOps));
                    } catch (SmbException exceptionThrownDuringBuildParcelable) {
                        Log.e(TAG, "Error creating HybridFileParcelable", exceptionThrownDuringBuildParcelable);
                    }
                    Log.e(TAG, errmsg, e);
                }
                return null;
            } else if (oldFile.isSftp()) {
                SshClientUtils.execute(new SFtpClientTemplate<Void>(oldFile.getPath()) {

                    @Override
                    public Void execute(@NonNull SFTPClient client) {
                        try {
                            client.rename(SshClientUtils.extractRemotePathFrom(oldFile.getPath()), SshClientUtils.extractRemotePathFrom(newFile.getPath()));
                            errorCallBack.done(newFile, true);
                        } catch (IOException e) {
                            String errmsg = context.getString(R.string.cannot_rename_file, HybridFile.parseAndFormatUriForDisplay(oldFile.getPath()), e.getMessage());
                            Log.e(TAG, errmsg);
                            ArrayList<HybridFileParcelable> failedOps = new ArrayList<>();
                            // Nobody care the size or actual permission here. Put a simple "r" and zero
                            // here
                            failedOps.add(new HybridFileParcelable(oldFile.getPath(), "r", oldFile.lastModified(), 0, oldFile.isDirectory(context)));
                            context.sendBroadcast(new Intent(TAG_INTENT_FILTER_GENERAL).putParcelableArrayListExtra(TAG_INTENT_FILTER_FAILED_OPS, failedOps));
                            errorCallBack.done(newFile, false);
                        }
                        return null;
                    }
                });
            } else if (oldFile.isDropBoxFile()) {
                CloudStorage cloudStorageDropbox = dataUtils.getAccount(OpenMode.DROPBOX);
                try {
                    cloudStorageDropbox.move(CloudUtil.stripPath(OpenMode.DROPBOX, oldFile.getPath()), CloudUtil.stripPath(OpenMode.DROPBOX, newFile.getPath()));
                    errorCallBack.done(newFile, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(newFile, false);
                }
            } else if (oldFile.isBoxFile()) {
                CloudStorage cloudStorageBox = dataUtils.getAccount(OpenMode.BOX);
                try {
                    cloudStorageBox.move(CloudUtil.stripPath(OpenMode.BOX, oldFile.getPath()), CloudUtil.stripPath(OpenMode.BOX, newFile.getPath()));
                    errorCallBack.done(newFile, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(newFile, false);
                }
            } else if (oldFile.isOneDriveFile()) {
                CloudStorage cloudStorageOneDrive = dataUtils.getAccount(OpenMode.ONEDRIVE);
                try {
                    cloudStorageOneDrive.move(CloudUtil.stripPath(OpenMode.ONEDRIVE, oldFile.getPath()), CloudUtil.stripPath(OpenMode.ONEDRIVE, newFile.getPath()));
                    errorCallBack.done(newFile, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(newFile, false);
                }
            } else if (oldFile.isGoogleDriveFile()) {
                CloudStorage cloudStorageGdrive = dataUtils.getAccount(OpenMode.GDRIVE);
                try {
                    cloudStorageGdrive.move(CloudUtil.stripPath(OpenMode.GDRIVE, oldFile.getPath()), CloudUtil.stripPath(OpenMode.GDRIVE, newFile.getPath()));
                    errorCallBack.done(newFile, true);
                } catch (Exception e) {
                    e.printStackTrace();
                    errorCallBack.done(newFile, false);
                }
            } else if (oldFile.isOtgFile()) {
                if (checkOtgNewFileExists(newFile, context)) {
                    errorCallBack.exists(newFile);
                    return null;
                }
                safRenameFile.apply(OTGUtil.getDocumentFile(oldFile.getPath(), context, false));
                return null;
            } else if (oldFile.isDocumentFile()) {
                if (checkDocumentFileNewFileExists(newFile, context)) {
                    errorCallBack.exists(newFile);
                    return null;
                }
                safRenameFile.apply(OTGUtil.getDocumentFile(oldFile.getPath(), SafRootHolder.getUriRoot(), context, OpenMode.DOCUMENT_FILE, false));
                return null;
            } else {
                File file = new File(oldFile.getPath());
                File file1 = new File(newFile.getPath());
                switch(oldFile.getMode()) {
                    case FILE:
                        int mode = checkFolder(file.getParentFile(), context);
                        if (mode == 2) {
                            errorCallBack.launchSAF(oldFile, newFile);
                        } else if (mode == 1 || mode == 0) {
                            try {
                                RenameOperation.renameFolder(file, file1, context);
                            } catch (ShellNotRunningException e) {
                                e.printStackTrace();
                            }
                            boolean a = !file.exists() && file1.exists();
                            if (!a && rootMode) {
                                try {
                                    RenameFileCommand.INSTANCE.renameFile(file.getPath(), file1.getPath());
                                } catch (ShellNotRunningException e) {
                                    e.printStackTrace();
                                }
                                oldFile.setMode(OpenMode.ROOT);
                                newFile.setMode(OpenMode.ROOT);
                                a = !file.exists() && file1.exists();
                            }
                            errorCallBack.done(newFile, a);
                            return null;
                        }
                        break;
                    case ROOT:
                        try {
                            RenameFileCommand.INSTANCE.renameFile(file.getPath(), file1.getPath());
                        } catch (ShellNotRunningException e) {
                            e.printStackTrace();
                        }
                        newFile.setMode(OpenMode.ROOT);
                        errorCallBack.done(newFile, true);
                        break;
                }
            }
            return null;
        }

        @Override
        protected void onPostExecute(Void aVoid) {
            super.onPostExecute(aVoid);
            if (newFile != null && oldFile != null) {
                HybridFile[] hybridFiles = { newFile, oldFile };
                FileUtils.scanFile(context, hybridFiles);
            }
        }
    }.executeOnExecutor(executor);
}
Also used : Context(android.content.Context) CloudStorage(com.cloudrail.si.interfaces.CloudStorage) URL(java.net.URL) MakeDirectoryCommand(com.amaze.filemanager.filesystem.root.MakeDirectoryCommand) NonNull(androidx.annotation.NonNull) MakeFileCommand(com.amaze.filemanager.filesystem.root.MakeFileCommand) Intent(android.content.Intent) SmbException(jcifs.smb.SmbException) OpenMode(com.amaze.filemanager.file_operations.filesystem.OpenMode) CloudUtil(com.amaze.filemanager.filesystem.cloud.CloudUtil) TAG_INTENT_FILTER_GENERAL(com.amaze.filemanager.ui.activities.MainActivity.TAG_INTENT_FILTER_GENERAL) ArrayList(java.util.ArrayList) ByteArrayInputStream(java.io.ByteArrayInputStream) SshClientUtils(com.amaze.filemanager.filesystem.ssh.SshClientUtils) ShellNotRunningException(com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException) DataUtils(com.amaze.filemanager.utils.DataUtils) SFTPClient(net.schmizz.sshj.sftp.SFTPClient) Build(android.os.Build) Function(androidx.arch.core.util.Function) TAG_INTENT_FILTER_FAILED_OPS(com.amaze.filemanager.ui.activities.MainActivity.TAG_INTENT_FILTER_FAILED_OPS) Log(android.util.Log) OutputStream(java.io.OutputStream) MalformedURLException(java.net.MalformedURLException) Executor(java.util.concurrent.Executor) OTGUtil(com.amaze.filemanager.utils.OTGUtil) AsyncTask(android.os.AsyncTask) IOException(java.io.IOException) TextUtils(android.text.TextUtils) FileUtils(com.amaze.filemanager.filesystem.files.FileUtils) File(java.io.File) SmbFile(jcifs.smb.SmbFile) DocumentFile(androidx.documentfile.provider.DocumentFile) RenameFileCommand(com.amaze.filemanager.filesystem.root.RenameFileCommand) R(com.amaze.filemanager.R) SFtpClientTemplate(com.amaze.filemanager.filesystem.ssh.SFtpClientTemplate) DocumentFile(androidx.documentfile.provider.DocumentFile) ArrayList(java.util.ArrayList) SFTPClient(net.schmizz.sshj.sftp.SFTPClient) Intent(android.content.Intent) IOException(java.io.IOException) SmbException(jcifs.smb.SmbException) ShellNotRunningException(com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) URL(java.net.URL) SmbFile(jcifs.smb.SmbFile) SmbException(jcifs.smb.SmbException) CloudStorage(com.cloudrail.si.interfaces.CloudStorage) ShellNotRunningException(com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException) DataUtils(com.amaze.filemanager.utils.DataUtils) File(java.io.File) SmbFile(jcifs.smb.SmbFile) DocumentFile(androidx.documentfile.provider.DocumentFile)

Aggregations

DocumentFile (androidx.documentfile.provider.DocumentFile)45 IOException (java.io.IOException)18 Uri (android.net.Uri)14 AssetsDocumentFile (androidx.documentfile.provider.AssetsDocumentFile)10 OutputStream (java.io.OutputStream)10 File (java.io.File)9 ArrayList (java.util.ArrayList)9 Test (org.junit.Test)8 CloudStorage (com.cloudrail.si.interfaces.CloudStorage)7 SFTPClient (net.schmizz.sshj.sftp.SFTPClient)7 OpenMode (com.amaze.filemanager.file_operations.filesystem.OpenMode)6 InputStream (java.io.InputStream)6 Intent (android.content.Intent)5 NonNull (androidx.annotation.NonNull)5 ShellNotRunningException (com.amaze.filemanager.file_operations.exceptions.ShellNotRunningException)5 SFtpClientTemplate (com.amaze.filemanager.filesystem.ssh.SFtpClientTemplate)5 DataUtils (com.amaze.filemanager.utils.DataUtils)5 SmbFile (jcifs.smb.SmbFile)5 ContentResolver (android.content.ContentResolver)4 Context (android.content.Context)4