| 282 | } |
| 283 | |
| 284 | async #getStat(url = this.#path) { |
| 285 | return new Promise((resolve, reject) => { |
| 286 | ftp.getStat( |
| 287 | this.#conId, |
| 288 | url, |
| 289 | (stat) => { |
| 290 | this.#stat = stat; |
| 291 | this.#stat.url = Url.join(this.#origin, url); |
| 292 | helpers.defineDeprecatedProperty( |
| 293 | this.#stat, |
| 294 | "uri", |
| 295 | function () { |
| 296 | return this.url; |
| 297 | }, |
| 298 | function (val) { |
| 299 | this.url = val; |
| 300 | }, |
| 301 | ); |
| 302 | if (this.#stat.isFile) { |
| 303 | this.#stat.type = mimeType.lookup(this.#stat.name); |
| 304 | } |
| 305 | resolve(this.#stat); |
| 306 | }, |
| 307 | (err) => { |
| 308 | console.error("Error while getting stat", err); |
| 309 | reject(err); |
| 310 | }, |
| 311 | ); |
| 312 | }); |
| 313 | } |
| 314 | |
| 315 | get #cacheFile() { |
| 316 | return Url.join( |