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

Method put

basex-core/src/main/java/org/basex/core/cmd/BinaryPut.java:80–91  ·  view source on GitHub ↗

Puts a binary resource in the specified database. @param data database @param bin binary file (can be null) @param path target path @return success flag @throws IOException I/O exception

(final Data data, final IOFile bin, final String path)

Source from the content-addressed store, hash-verified

78 * @throws IOException I/O exception
79 */
80 private boolean put(final Data data, final IOFile bin, final String path) throws IOException {
81 final IntList docs = data.resources.docs(path);
82 if(options.get(MainOptions.REPLACE) || docs.isEmpty() && !bin.exists()) {
83 // delete XML documents
84 final AtomicUpdateCache auc = new AtomicUpdateCache(data);
85 for(final int pre : docs.toArray()) auc.addDelete(pre);
86 auc.execute(false);
87
88 put(in, bin);
89 }
90 return info(QUERY_EXECUTED_X_X, "", jc().performance);
91 }
92
93 /**
94 * Writes the specified source to the specified file.

Callers 1

runMethod · 0.95

Calls 15

toArrayMethod · 0.95
addDeleteMethod · 0.95
executeMethod · 0.95
getMethod · 0.95
getMethod · 0.95
jcMethod · 0.80
mdMethod · 0.80
getMethod · 0.65
infoMethod · 0.65
readMethod · 0.65
printMethod · 0.65
docsMethod · 0.45

Tested by

no test coverage detected