The above part must be optimized. It is actually 2 times the same thing except for a different .h and .cpp location.
What I want to see is something like
String cppTemplateFile="templates/sketch.cpp";
String hTemplateFile="templates/sketch.h";
  String Include = "WProgram.h";
   if (ArduinoInstancePreferences.isArduinoIdeOne()) // Arduino v1.0+
    {
        Include = "Arduino.h";
    }
 if (ArduinoInstancePreferences.getLastUsedDefaultSketchSelection() == true) {
 String folderName = ArduinoInstancePreferences.getLastTemplateFolderName();
  cppTemplateFile=folderName + "\\sketch.cpp";
  hTemplateFile=folderName + "\\sketch.h";
}
ArduinoHelpers.addFileToProject(container, new Path(project.getName() + ".cpp"), DiskStream.openContentStream(project.getName(), "", cppTemplateFile), monitor);
   /* Add the sketch header file */

    ArduinoHelpers.addFileToProject(container, new Path(project.getName() + ".h"),
       DiskStream.openContentStream(project.getName(), Include, fhTemplateFile), monitor);