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

Method run

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

Source from the content-addressed store, hash-verified

44 }
45
46 @Override
47 protected boolean run() {
48 // check if the input source has already been initialized
49 if(in == null) {
50 final IO io = IO.get(args[1]);
51 if(!io.exists()) return error(RES_NOT_FOUND_X, io);
52 in = io.inputSource();
53 }
54
55 final String path = MetaData.normPath(args[0]);
56 if(path == null) return error(PATH_INVALID_X, args[0]);
57
58 final Data data = context.data();
59 final IOFile bin = data.meta.file(path, ResourceType.BINARY);
60
61 return update(data, () -> put(data, bin, path));
62 }
63
64 /**
65 * Puts (adds or replaces) resources in the specified database.

Callers

nothing calls this directly

Calls 9

getMethod · 0.95
existsMethod · 0.95
inputSourceMethod · 0.95
normPathMethod · 0.95
putMethod · 0.95
errorMethod · 0.45
dataMethod · 0.45
fileMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected