copyFile

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

Copies a file.

Return

the destination file

Parameters

src

source file

path

destination directory path

name

destination file name


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

Copies a file. Only supports file:// scheme paths.

Return

whether the copy was successful

Parameters

srcPath

source file path

path

destination directory path

name

destination file name


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

Return

whether the file was copied successfully

Parameters

context

context

srcUri

content:// URI obtained from MediaStore

desPath

destination path under the app's package directory