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

Method delete

src/fileSystem/ftp.js:192–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190 }
191
192 async delete() {
193 await this.#connectIfNotConnected();
194 if (!this.#stat) {
195 await this.#getStat();
196 }
197 return new Promise((resolve, reject) => {
198 let deleteOperation;
199
200 if (this.#stat.isDirectory) {
201 deleteOperation = ftp.deleteDirectory;
202 } else {
203 deleteOperation = ftp.deleteFile;
204 }
205
206 deleteOperation(
207 this.#conId,
208 this.#path,
209 () => {
210 resolve(Url.join(this.#origin, this.#path));
211 },
212 reject,
213 );
214 });
215 }
216
217 async rename(newName) {
218 await this.#connectIfNotConnected();

Callers

nothing calls this directly

Calls 3

#getStatMethod · 0.95
resolveFunction · 0.85

Tested by

no test coverage detected