mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
remove file:// protocol from various fileutils remove methods
This commit is contained in:
parent
0ba803ff46
commit
7e4158ce94
@ -555,6 +555,10 @@ public class FileUtils extends Plugin {
|
|||||||
* @throws FileExistsException
|
* @throws FileExistsException
|
||||||
*/
|
*/
|
||||||
private boolean removeRecursively(String filePath) throws FileExistsException {
|
private boolean removeRecursively(String filePath) throws FileExistsException {
|
||||||
|
if (filePath.startsWith("file://")) {
|
||||||
|
filePath = filePath.substring(7);
|
||||||
|
}
|
||||||
|
|
||||||
File fp = new File(filePath);
|
File fp = new File(filePath);
|
||||||
|
|
||||||
// You can't delete the root directory.
|
// You can't delete the root directory.
|
||||||
@ -596,6 +600,10 @@ public class FileUtils extends Plugin {
|
|||||||
* @throws InvalidModificationException
|
* @throws InvalidModificationException
|
||||||
*/
|
*/
|
||||||
private boolean remove(String filePath) throws NoModificationAllowedException, InvalidModificationException {
|
private boolean remove(String filePath) throws NoModificationAllowedException, InvalidModificationException {
|
||||||
|
if (filePath.startsWith("file://")) {
|
||||||
|
filePath = filePath.substring(7);
|
||||||
|
}
|
||||||
|
|
||||||
File fp = new File(filePath);
|
File fp = new File(filePath);
|
||||||
|
|
||||||
// You can't delete the root directory.
|
// You can't delete the root directory.
|
||||||
|
Loading…
Reference in New Issue
Block a user