public void writeDataToFile(String filerPath) throws Exception {
  if (!filerPath.endsWith(".ics"))   filerPath=filerPath + ".ics";
  FileOutputStream fout=new FileOutputStream(filerPath);
  CalendarOutputter outputter=new CalendarOutputter();
  outputter.output(icsCalendar,fout);
}

public void writeDataToFile ( String filerPath ) throws Exception { if ( ! filerPath . endsWith ( ".ics" ) ) filerPath = filerPath + ".ics" ; FileOutputStream fout = new FileOutputStream ( filerPath ) ; CalendarOutputter outputter = new CalendarOutputter ( ) ; outputter . output ( icsCalendar , fout ) ; }
write ical to file
