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

Method put

basex-core/src/main/java/org/basex/query/func/db/DbNew.java:217–228  ·  view source on GitHub ↗

Checks if a PUT operation should be performed. @param docs existing documents @param data data reference @param path target path @param options options @return result of check

(final IntList docs, final Data data, final String path,
      final HashMap<String, String> options)

Source from the content-addressed store, hash-verified

215 * @return result of check
216 */
217 final boolean put(final IntList docs, final Data data, final String path,
218 final HashMap<String, String> options) {
219 final String pr = options.get(MainOptions.REPLACE.name().toLowerCase(Locale.ENGLISH));
220 if(pr == null || Strings.toBoolean(pr)) return true;
221
222 boolean add = docs.isEmpty();
223 for(final ResourceType type : Resources.BINARIES) {
224 final IOFile bin = data.meta.file(path, type);
225 add &= bin == null || !bin.exists();
226 }
227 return add;
228 }
229}

Callers 15

checkMethod · 0.45
toBindingsMethod · 0.45
optimizeMethod · 0.45
copyMethod · 0.45
hasMethod · 0.45
RecordsEnum · 0.45
FunctionsClass · 0.45
cacheMethod · 0.45
addMethod · 0.45
DigitalSignatureClass · 0.45
EncryptionClass · 0.45

Calls 6

toBooleanMethod · 0.95
existsMethod · 0.95
getMethod · 0.65
nameMethod · 0.65
isEmptyMethod · 0.45
fileMethod · 0.45

Tested by

no test coverage detected