public static void publishOutput(Object[] what) {
        //String text, String title.
            String text = (String)what[0];
            String file = (String)what[1];
            FileWriter w = null;
            try {
              w = new FileWriter(file);
            } catch (IOException ex) {
                Logger.getLogger(Output.class.getName()).log(Level.SEVERE, null, ex);
            }
            BufferedWriter bw = new BufferedWriter(w);
            PrintWriter wr = new PrintWriter(bw);  
            try{
                wr.write(text); //It writes the file
                wr.close();
                bw.close();
            }catch(IOException e){}

	}