File close(long hash) {
            verifyHash(hash);

            File decompressedDir = null;
            try {
                if (fileType == Type.file) {
                    log.log(Level.FINE, () -> "Uncompressed file, moving to " + file.getAbsolutePath());
                    moveFileToDestination(inProgressDir, fileReferenceDir);
                } else {
                    decompressedDir = Files.createTempDirectory(tmpDir.toPath(), "archive").toFile();
                    log.log(Level.FINEST, () -> "compression type to use=" + compressionType);
                    new FileReferenceCompressor(fileType, compressionType).decompress(file, decompressedDir);
                    log.log(Level.FINE, "Compressed file, moving to " + decompressedDir.getAbsolutePath());
                    moveFileToDestination(decompressedDir, fileReferenceDir);
                }
            } catch (IOException e) {
                log.log(Level.SEVERE, "Failed writing file: " + e.getMessage(), e);
                throw new RuntimeException("Failed writing file: ", e);
            } finally {
                deletePath(inProgressDir);
                deletePath(decompressedDir);
            }
            return new File(fileReferenceDir, fileName);
        }
When asking for a file reference, this handles RPC callbacks from config server with file data and metadata.
Uses the same Supervisor as the original caller that requests files, so communication uses the same
connection in both directions.

@author baldersheim
filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReceiver.java