/**
  * Write to file.
  *
  * @param properties the properties
  * @param file the file
  * @param comments the comments
  * @throws IOException Signals that an I/O exception has occurred.
  * @throws CoreException the core exception
  */
 public static void writeToFile(Properties properties, IFile file, String comments)
     throws IOException, CoreException {
   OutputStream output = null;
   try {
     output = new ByteArrayOutputStream();
     properties.store(output, comments);
     WorkspaceUtil.writeToFile(output.toString(), file, null);
   } finally {
     IOUtils.closeQuietly(output);
   }
 }