copyFile

public static File copyFile(File src, String path, String name)

Copy a file

Return

Destination file

Parameters

src

Source file

path

Destination file path

name

Destination file name


public static boolean copyFile(String srcPath, String path, String name)

Copy files, only supports files starting with 'file'

Return

Indicates whether the copy operation was successful

Parameters

srcPath

Source file path

path

Destination file path

name

Destination file name


public static boolean copyFile(Context context, Uri srcUri, String desPath)

Return

The file copied to the package-specific storage path

Parameters

context

Context

srcUri

URI obtained from MediaStore, starting with content://

desPath

Storage path under the package name, starting with storage:// (must be a directly accessible path under the package name)