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

Method moveTo

src/fileSystem/ftp.js:235–250  ·  view source on GitHub ↗
(newPath)

Source from the content-addressed store, hash-verified

233 }
234
235 async moveTo(newPath) {
236 newPath = Path.join(newPath, Path.basename(this.#path));
237 await this.#connectIfNotConnected();
238 return new Promise((resolve, reject) => {
239 ftp.rename(
240 this.#conId,
241 this.#path,
242 newPath,
243 async () => {
244 this.#path = newPath;
245 resolve(Url.join(this.#origin, newPath));
246 },
247 reject,
248 );
249 });
250 }
251
252 async exists() {
253 await this.#connectIfNotConnected();

Callers 3

pasteFunction · 0.45
moveToFunction · 0.45
renameFileFunction · 0.45

Calls 4

resolveFunction · 0.85
basenameMethod · 0.80
renameMethod · 0.65

Tested by

no test coverage detected