@Override
    public void completed(Object result, Object attachment) {
        try {
            fileChannel.close();
            String path = (String) attachment;
            worker.writeFile(socketChannel, buffer, path);
        }
        catch (IOException exc) {
            exc.printStackTrace();
        }
    }