mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
Merge pull request #1536 from NativeScript/file-exist
File exists fixed
This commit is contained in:
@ -75,16 +75,12 @@ 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();
|
return file.exists() && !file.isDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
public folderExists(path: string): boolean {
|
public folderExists(path: string): boolean {
|
||||||
var file = new java.io.File(path);
|
var file = new java.io.File(path);
|
||||||
var exists = file.exists();
|
return file.exists() && file.isDirectory();
|
||||||
var dir = file.isDirectory();
|
|
||||||
|
|
||||||
// return file.exists() && file.getCanonicalFile().isDirectory();
|
|
||||||
return exists && dir;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public deleteFile(path: string, onError?: (error: any) => any) {
|
public deleteFile(path: string, onError?: (error: any) => any) {
|
||||||
|
Reference in New Issue
Block a user