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

Method sandpit

basex-tests/src/main/java/org/basex/tests/bxapi/XQuery.java:198–210  ·  view source on GitHub ↗

Prepares a sandpit. @param source source directory (null if no files should be copied) @param dir sandpit directory @throws XQueryException exception

(final Path source, final IOFile dir)

Source from the content-addressed store, hash-verified

196 * @throws XQueryException exception
197 */
198 public void sandpit(final Path source, final IOFile dir) {
199 try {
200 final Path target = Paths.get(dir.path(), "sandpit");
201 if(source != null) {
202 final Job job = new Job() { };
203 if(Files.exists(target)) FileDelete.delete(target, job);
204 FileCopy.relocate(source, target, true, new Job() { });
205 }
206 qp.qc.resources.sandpit(target);
207 } catch(final IOException ex) {
208 throw new XQueryException(ex);
209 }
210 }
211
212 /**
213 * Returns the next item, or {@code null} if all items have been returned.

Callers 1

environmentMethod · 0.45

Calls 5

deleteMethod · 0.95
relocateMethod · 0.95
getMethod · 0.65
pathMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected