title: Ionic Native File Plugin - Checking Directory's Existence Not Working
body: <p>im trying out some ionic native plugins, so far everything has been great excpet for the file plugin.
  I've been trying to create directory in the externalDataDirectory path provided by the file plugin.
  What am trying to do is check if the directory exists first but that actually seems to be the issue.
  Here is my code.</p>
  
  <pre><code>import { File } from '@ionic-native/file';
  import { FilePath } from '@ionic-native/file-path';
  
  export class MyClass {
  
      constructor(private file: File, private filePath: FilePath) {}
  
      createDirectory(onSuccess?: (val: any) =&gt; any, onError?: (err: any) =&gt; any) {
      // root_dir = this.file.externalDataDirectory
      this.filePath.resolveNativePath(this.root_dir).then(
        (nativePath) =&gt; {
          this.file.checkDir(nativePath, 'myDir').then(
            (exists) =&gt; {
              if (!exists) {
                this.file.createDir(nativePath, 'myDir', false).then(
                  (dirEntry) =&gt; {
                    onSuccess(dirEntry);
                  },
                  (err) =&gt; {
                    console.log('CreateDir error: ' + err);
                    onError(err);
                  }
                ).catch( (exception) =&gt; { console.log(exception); } );
              }
              else {
                return nativePath + 'myDir';
              }
            },
            (err) =&gt; {
              console.log('CheckDir error: ' + err);
              onError(err);
            }
          ).catch( (exception) =&gt; { console.log(exception); } );
        },
        (err) =&gt; {
         // error occurs here.
          onError(err);
        }
      )
    }
  }
  </code></pre>
  
  <p>I dont know what im doing wrong, can anyone be of assistance. Thanks!!!</p>