code: public static void storeProperties(Properties p, File file) throws IOException {
          FileOutputStream fos = new FileOutputStream(file);
          try {
              p.store(fos,"");
          } finally {
              ArchiveUtils.closeQuietly(fos);
          }
      }
docs: Store Properties instance to a File
  @param p
  @param file destination File
  @throws IOException