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