This code takes html file as an input and converts it into the js file.

 import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.OutputStream;
import java.io.PrintStream;

public class ChangeFileM {

  public static void main(String[] args) {
          try {

              BufferedReader obj1 = new BufferedReader(new
      FileReader("c:\\terms and conditions.html"));
  
              OutputStream os= new FileOutputStream(new File("c:\\out.js"));
              PrintStream ps = new PrintStream(os);

              String line;
              String prefix="document.write('";
              String sufix="');";

              while ((line = obj1.readLine())!= null) {
                  line = prefix + line + sufix;
                  ps.println(line);

              }

              ps.close();
              os.close();
              obj1.close();
              //out1.close();
  
          } catch (Exception e) {

          }
     }
}