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

Method rename

src/fileSystem/ftp.js:217–233  ·  view source on GitHub ↗
(newName)

Source from the content-addressed store, hash-verified

215 }
216
217 async rename(newName) {
218 await this.#connectIfNotConnected();
219 const path = Path.dirname(this.#path);
220 const newPath = Path.join(path, newName);
221 return new Promise((resolve, reject) => {
222 ftp.rename(
223 this.#conId,
224 this.#path,
225 newPath,
226 async () => {
227 this.#path = newPath;
228 resolve(Url.join(this.#origin, newPath));
229 },
230 reject,
231 );
232 });
233 }
234
235 async moveTo(newPath) {
236 newPath = Path.join(newPath, Path.basename(this.#path));

Callers

nothing calls this directly

Calls 3

resolveFunction · 0.85
renameMethod · 0.65

Tested by

no test coverage detected