()
| 502 | } |
| 503 | |
| 504 | public read(): Promise<any> { |
| 505 | return new Promise<any>((resolve, reject) => { |
| 506 | try { |
| 507 | this._checkAccess(); |
| 508 | } catch (ex) { |
| 509 | reject(ex); |
| 510 | |
| 511 | return; |
| 512 | } |
| 513 | |
| 514 | this._locked = true; |
| 515 | |
| 516 | getFileAccess() |
| 517 | .readAsync(this.path) |
| 518 | .then( |
| 519 | (result) => { |
| 520 | resolve(result); |
| 521 | this._locked = false; |
| 522 | }, |
| 523 | (error) => { |
| 524 | reject(error); |
| 525 | this._locked = false; |
| 526 | }, |
| 527 | ); |
| 528 | }); |
| 529 | } |
| 530 | |
| 531 | public readSync(onError?: (error: any) => any): any { |
| 532 | this._checkAccess(); |
nothing calls this directly
no test coverage detected