{"record":{"id":"d1b22aab7574217f","repo":"MuntashirAkon/AppManager","slug":"either-source-or-destination-are-a-mount-point","errorCode":null,"errorMessage":"Either source or destination are a mount point.","messagePattern":"Either source or destination are a mount point\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/io/PathImpl.java","lineNumber":1045,"sourceCode":"                copyFile(context, source, newPath);\n                return new PathImpl(context, newPath);\n            } catch (IOException e) {\n                Log.d(TAG, \"Could not copy files.\", e);\n                return null;\n            }\n        }\n        Log.d(TAG, \"Unknown error during copying.\");\n        return null;\n    }\n\n    private static void copyFile(@NonNull Context context, @NonNull DocumentFile src, @NonNull DocumentFile dst)\n            throws IOException {\n        copyFile(new PathImpl(context, src), new PathImpl(context, dst));\n    }\n\n    private static void copyFile(@NonNull Path src, @NonNull Path dst) throws IOException {\n        if (src.isMountPoint() || dst.isMountPoint()) {\n            throw new IOException(\"Either source or destination are a mount point.\");\n        }\n        IoUtils.copy(src, dst);\n    }\n\n    // Copy directory content\n    private static void copyDirectory(@NonNull Context context, @NonNull DocumentFile src, @NonNull DocumentFile dst,\n                                      boolean override) throws IOException {\n        copyDirectory(new PathImpl(context, src), new PathImpl(context, dst), override);\n    }\n\n    private static void copyDirectory(@NonNull Context context, @NonNull DocumentFile src, @NonNull DocumentFile dst)\n            throws IOException {\n        copyDirectory(new PathImpl(context, src), new PathImpl(context, dst), true);\n    }\n\n    private static void copyDirectory(@NonNull Path src, @NonNull Path dst, boolean override) throws IOException {\n        for (Path file : src.listFiles()) {\n            String name = file.getName();","sourceCodeStart":1027,"sourceCodeEnd":1063,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/io/PathImpl.java#L1027-L1063","documentation":"copyFile() refuses to copy when either the source or destination Path is a mount point (VirtualFileSystem root or other mounted location), throwing IOException(\"Either source or destination are a mount point.\"). Copying across/onto mount boundaries through this code path is unsupported and could bypass the virtual filesystem's isolation.","triggerScenarios":"Calling copy operations (copyInOut/copyFile via PathImpl static helpers, or Path.copy variants that route here) where src.isMountPoint() or dst.isMountPoint() returns true — e.g. src or dst is a VFS root like a remote/SAF mount root.","commonSituations":"Copying from/to the root of a mounted remote filesystem (FTP/SMB/SAF custom mounts in this library), or pointing a destination directly at a mount root instead of a file inside it.","solutions":["Copy to/from a path inside the mount rather than the mount root itself","Copy the mount point's contents recursively instead of the mount point as a unit","Check isMountPoint() on both paths beforehand and route to an alternative copy mechanism"],"exampleFix":"// before\nIoUtils.copy(mountRootPath, dst);\n// after\nif (mountRootPath.isMountPoint() || dst.isMountPoint()) {\n    throw new IllegalArgumentException(\"Choose a non-mount-point source/destination\");\n}\nIoUtils.copy(mountRootPath, dst);","handlingStrategy":"validation","validationCode":"if (src.isMountPoint() || dst.isMountPoint()) {\n    throw new IllegalArgumentException(\"Copy must not target or originate at a mount point\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    // copy operation\n} catch (IOException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"mount point\")) {\n        // switch to a path inside the mount instead of its root\n    } else throw e;\n}","preventionTips":["Check isMountPoint() on both endpoints before copying","Copy mount contents recursively instead of the mount itself","Keep destinations under a real directory, never a VFS root"],"tags":["io","mount","vfs","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}