MCPcopy Create free account
hub / github.com/BaseXdb/basex / run

Method run

basex-core/src/main/java/org/basex/core/cmd/Delete.java:27–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 }
26
27 @Override
28 protected boolean run() {
29 final Data data = context.data();
30 final String path = MetaData.normPath(args[0]);
31 if(path == null) return error(PATH_INVALID_X, args[0]);
32
33 final IntList docs = data.resources.docs(path);
34 return update(data, () -> {
35 // delete XML documents
36 final AtomicUpdateCache auc = new AtomicUpdateCache(data);
37 for(final int pre : docs.toArray()) auc.addDelete(pre);
38 auc.execute(false);
39 // delete binaries
40 int size = docs.size();
41 for(final ResourceType type : Resources.BINARIES) {
42 size += binaries(data, path, type);
43 }
44 return info(RES_DELETED_X_X, size, jc().performance);
45 });
46 }
47
48 /**
49 * Deletes binary resources.

Callers

nothing calls this directly

Calls 12

normPathMethod · 0.95
toArrayMethod · 0.95
addDeleteMethod · 0.95
executeMethod · 0.95
binariesMethod · 0.95
jcMethod · 0.80
sizeMethod · 0.65
infoMethod · 0.65
dataMethod · 0.45
errorMethod · 0.45
docsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected