private void moveProcessedFile(File f, Path path) {
        Path file = f.toPath();
        Path target = spoolPath.resolve(path).resolve(f.toPath().relativize(file)).resolve(f.getName());
        try {
            Files.move(file, target);
        } catch (IOException e) {
            log.log(Level.SEVERE, "Unable to move processed file " + file + " to " + target, e);
        }
    }
Spooler that will write an entry to a file and read files that are ready to be sent.
Files are written in JSON Lines text file format.

@author hmusum
container-search/src/main/java/com/yahoo/search/logging/Spooler.java