Merge pull request #1579 from NativeScript/file-exists

File.exists() code reverted
This commit is contained in:
Vladimir Enchev
2016-02-18 15:56:05 +02:00
3 changed files with 4 additions and 5 deletions

View File

@@ -31,6 +31,5 @@ export var test_file_exists_on_folder = function () {
return; return;
} }
TKUnit.assertFalse(fs.File.exists(path), "File.exists() returned true for folder!"); TKUnit.assertTrue(fs.File.exists(path), "File.exists() returned false for folder!");
}; };

View File

@@ -75,7 +75,7 @@ export class FileSystemAccess {
public fileExists(path: string): boolean { public fileExists(path: string): boolean {
var file = new java.io.File(path); var file = new java.io.File(path);
return file.exists() && !file.isDirectory(); return file.exists();
} }
public folderExists(path: string): boolean { public folderExists(path: string): boolean {

View File

@@ -148,7 +148,7 @@ export class FileSystemAccess {
public fileExists(path: string): boolean { public fileExists(path: string): boolean {
var result = this.exists(path); var result = this.exists(path);
return result.exists && !result.isDirectory; return result.exists;
} }
public folderExists(path: string): boolean { public folderExists(path: string): boolean {