(content: string, encoding?: string)
| 408 | } |
| 409 | |
| 410 | public appendText(content: string, encoding?: string): Promise<any> { |
| 411 | return new Promise((resolve, reject) => { |
| 412 | try { |
| 413 | this._checkAccess(); |
| 414 | } catch (ex) { |
| 415 | reject(ex); |
| 416 | |
| 417 | return; |
| 418 | } |
| 419 | |
| 420 | this._locked = true; |
| 421 | |
| 422 | getFileAccess() |
| 423 | .appendTextAsync(this.path, content, encoding) |
| 424 | .then( |
| 425 | () => { |
| 426 | resolve(true); |
| 427 | this._locked = false; |
| 428 | }, |
| 429 | (error) => { |
| 430 | reject(error); |
| 431 | this._locked = false; |
| 432 | }, |
| 433 | ); |
| 434 | }); |
| 435 | } |
| 436 | |
| 437 | public appendTextSync(content: string, onError?: (error: any) => any, encoding?: string): void { |
| 438 | this._checkAccess(); |
nothing calls this directly
no test coverage detected