From 5c1639b36f6c5b7bc8c5f0e3c846840221cde519 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 11 Feb 2016 14:23:48 +0200 Subject: [PATCH] File exists fixed --- file-system/file-system-access.android.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/file-system/file-system-access.android.ts b/file-system/file-system-access.android.ts index 1c9db40d9..a2f305244 100644 --- a/file-system/file-system-access.android.ts +++ b/file-system/file-system-access.android.ts @@ -75,16 +75,12 @@ export class FileSystemAccess { public fileExists(path: string): boolean { var file = new java.io.File(path); - return file.exists(); + return file.exists() && !file.isDirectory(); } public folderExists(path: string): boolean { var file = new java.io.File(path); - var exists = file.exists(); - var dir = file.isDirectory(); - - // return file.exists() && file.getCanonicalFile().isDirectory(); - return exists && dir; + return file.exists() && file.isDirectory(); } public deleteFile(path: string, onError?: (error: any) => any) {