Skip to content

Instantly share code, notes, and snippets.

@razerdp
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save razerdp/1eb5ab1d9355d815c652 to your computer and use it in GitHub Desktop.
Save razerdp/1eb5ab1d9355d815c652 to your computer and use it in GitHub Desktop.
新增方法
DevToolsFactory.getFileTools().copyfile(String fromPath, String toPath, Boolean rewrite)
在您需要用的地方请调用它,然后传入源文件的路径和目标文件的路径,并设置是否可以覆盖目标文件
请务必保证路径的绝对性以及加上文件的后缀
例如fromPath="sdcard/xxx/xxx.txt"
同样,目标文件例子:toPath="sdcard/xxx/xxx.txt"
当rewrite为true时,若目标文件存在,则会覆盖目标文件。
当rewrite为false时,若目标文件存在,则会在原目标文件的末尾加上-new。
使用前请务必加上必要的权限。
以上......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment