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)
| 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. |