void addPart(int partId, byte [] part) {
            if (partId != currentPartId) {
                throw new IllegalStateException("Received partid " + partId + " while expecting " + currentPartId);
            }
            if (fileSize < currentFileSize + part.length) {
                throw new IllegalStateException("Received part would extend the file from " + currentFileSize + " to " +
                                                (currentFileSize + part.length) + ", but " + fileSize + " is max.");
            }
            try {
                Files.write(file.toPath(), part, WRITE, file.exists() ? APPEND : CREATE);
            } catch (IOException e) {
                String message = "Failed writing to file (" + inProgressDir.toPath() + "): ";
                log.log(Level.SEVERE, message + e.getMessage(), e);
                boolean successfulDelete = inProgressDir.delete();
                if ( ! successfulDelete)
                    log.log(Level.INFO, "Unable to delete " + inProgressDir.toPath());
                throw new RuntimeException(message, e);
            }
            currentFileSize += part.length;
            currentPartId++;
            hasher.update(part, 0, part.length);
        }
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