// 1.设置yml格式,一般使用的是最喜欢的格式
DumperOptions dumperOptions = new DumperOptions();
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
// 2.创建FileWriter
// 路径放自己的路径
String configPath = "D:\\code\\java\\demo3\\StudentDemo\\vhost\\gcuvfijyf.yaml";
FileWriter fileWriter = null;
try {
fileWriter = new FileWriter(new File(configPath));
} catch (IOException e) {
e.printStackTrace();
}