private void handleFilePullRequest() throws IOException {
        logger.debug("File pull request");

        OutputStream output = socket.getOutputStream();

        // Get the filename
        byte[] buffer = new byte[36];
        socket.getInputStream().read(buffer);
        UUID fileid = UUID.fromString(new String(buffer));

        try {
            parent.getServermanager().getArchive().checkIfExists(fileid);
        } catch (NoSuchFileException nsfe) {
            // Send response that server does not have that file
            logger.debug("File was not found.");

            // Mark that we do not know the file..
            output.write((byte) ConnectionMessages.SERVER_FILEPULL_MISSING);
            output.flush();

            logger.debug("File transfer aborted.");
            return;
        }

        // File exists!

        logger.debug("Sending file to client.");
        // First mark that we are sending the file
        output.write((byte) ConnectionMessages.SERVER_FILEPULL_SENDING);
        output.flush();

        long filesize = parent.getServermanager().getArchive().getFileSize(fileid);
        logger.debug(" bytes to transfer: " + filesize);
        // Write the filesize
        output.write(Utilities.longToBytes(filesize));
        output.flush();

        // Prepare databuff
        byte[] bytearray = new byte[BUFFER_SIZE];

        InputStream fin = null;
        BufferedInputStream bin = null;
        try {
            // load the file into the databuffer array
            fin = parent.getServermanager().getArchive().getFile(fileid);
            bin = new BufferedInputStream(fin);

            // Sending the data in chunks
            int length;
            while ((length = bin.read(bytearray)) != -1) {
                output.write(bytearray, 0, length);
                output.flush();
            }

            logger.debug("File transfer complete!");
        } finally {
            try {
                if (fin != null) {
                    fin.close();
                }
            } catch (IOException ex) {
            }
            try {
                if (bin != null) {
                    bin.close();
                }
            } catch (IOException ex) {
            }
        }
    }