File exists fixed

This commit is contained in:
Vladimir Enchev
2016-02-11 14:23:48 +02:00
parent fb4d83d44e
commit 5c1639b36f

View File

@@ -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) {