public void writeDataFile(String contentToWrite, String personName, String topic) {
        // Checks if personName is null of empty
        if (personName == null || personName.isEmpty()) {
            personName = "All Speakers";
        }

        // Checks if topic is null or empty
        if (topic == null || topic.isEmpty()) {
            topic = "All Topics";
        }

        String fileName = personName + "_" + topic;
        if (fileName.endsWith(" ")){
               fileName = fileName.substring(0, fileName.length()-1);
            }

        // Create folder to store folers for each search

        File dir1 = new File(System.getProperty("user.home") + "/Desktop","Provincial Mining");

        dir1.mkdir();
        // Create folder to store .PRO, .html, .txt, and .docx files
        // for each search
        File dir2 = new File(dir1, "Quebec");
        dir2.mkdir();

        // Creates a folder in previously created directoy named the person's
        // name followed by the topic
        File dir3 = new File(dir2, fileName);
        dir3.mkdir();

        // Replace generic tags with <ignore> tags needed for .PRO and .txt files
        contentToWrite = contentToWrite.replace("<name>", "<ignore>");
        contentToWrite = contentToWrite.replace("</name>", "</ignore>");
        contentToWrite = contentToWrite.replace("<topic>", "<ignore>");
        contentToWrite = contentToWrite.replace("</topic>", "</ignore>");
        contentToWrite = contentToWrite.replace("<date>", "<ignore>");
        contentToWrite = contentToWrite.replace("</date>", "</ignore>");

        // Write .PRO file  
        writeToFile(dir3, fileName + ".PRO", contentToWrite);

        // Write .txt file
        writeToFile(dir3, fileName + ".txt", contentToWrite);

        // Replaces <ignore> tags with <p> html tags
        contentToWrite = contentToWrite.replace("<ignore>", "<p>");
        contentToWrite = contentToWrite.replace("</ignore>", "</p>");

        // Write .html file
        writeToFile(dir3, fileName + ".html", contentToWrite);

        // Open folder containing files just written
        try {
            Desktop.getDesktop().open(dir3);
        } catch (IOException ex) {
            Logger.getLogger(WriteFile.class.getName()).log(Level.SEVERE, null, ex);
        }

    }