MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / #getStat

Method #getStat

src/fileSystem/ftp.js:284–313  ·  view source on GitHub ↗
(url = this.#path)

Source from the content-addressed store, hash-verified

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(

Callers 2

deleteMethod · 0.95
statMethod · 0.95

Calls 3

resolveFunction · 0.85
getStatMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected