MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / checkFileExtension

Method checkFileExtension

lib/ldp.mjs:307–316  ·  view source on GitHub ↗
(urlArg, pathArg)

Source from the content-addressed store, hash-verified

305 }
306
307 async checkFileExtension (urlArg, pathArg) {
308 try {
309 const { path: existingPath } = await this.resourceMapper.mapUrlToFile({ url: urlArg })
310 if (pathArg !== existingPath) {
311 try {
312 await withLock(existingPath, () => promisify(fs.unlink)(existingPath))
313 } catch (err) { throw error(err, 'Failed to delete resource') }
314 }
315 } catch (err) { }
316 }
317
318 /**
319 * This function is used to make sure a resource or container which contains

Callers 1

putMethod · 0.95

Calls 2

withLockFunction · 0.85
mapUrlToFileMethod · 0.80

Tested by

no test coverage detected