Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Main {
    public static String writeXMLToFile(String resString, String fileName) {
        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter(new File(fileName)));
            writer.write(resString);
            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
        return fileName;
    }
}