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)
| 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 | } |
no test coverage detected