()
| 90 | } |
| 91 | |
| 92 | async listDir() { |
| 93 | await this.#connectIfNotConnected(); |
| 94 | return new Promise((resolve, reject) => { |
| 95 | ftp.listDirectory( |
| 96 | this.#conId, |
| 97 | this.#path, |
| 98 | (list) => { |
| 99 | resolve( |
| 100 | list.map((i) => { |
| 101 | i.url = Url.join(this.#origin, i.url); |
| 102 | if (i.isFile) { |
| 103 | i.type = mimeType.lookup(i.name); |
| 104 | } |
| 105 | return i; |
| 106 | }), |
| 107 | ); |
| 108 | }, |
| 109 | reject, |
| 110 | ); |
| 111 | }); |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Read file from ftp server |
nothing calls this directly
no test coverage detected