code: public static void writeAndClose(String path) throws IOException, NoSuchMethodException, IllegalAccessException,
              InvocationTargetException {
          createXwpfDocumentIfNull();
          writeTo(path);
          xwpfDocument.close();
          xwpfDocument = new XWPFDocument();
      }
docs: 保存word文档，关闭当前文档，并生成新的文档对象
  
  @param path 路径
  
  @throws IOException 异常
  @throws NoSuchMethodException 异常
  @throws IllegalAccessException 异常
  @throws InvocationTargetException 异常