我在解析yaml文件时出错了
Yaml:
!!com.exalow.easymind.core.entities.UserImpl
avatarUrl: avatar.jpg
email: wowo.owow@magicmail.com
id: '8733a58c-4aaf-4da0-bbe7-aaf7ad66ab7a'
password: '1234'
username: Exalow
workspace: "Path"
错误:
Exception in thread "main" mapping values are not allowed here
in 'string', line 1, column 95:
... jpgemail: wowo.owow@magicmail.comid: '8733a58c-4aaf-4da0-bbe7-aaf7a ...
我使用以下代码读取文件:https://pastebin.com/thdrgxkn
似乎缺少行尾字符(至少在前两行)。 您是否会先用BufferedReader.readLine()将内容从文件中读入字符串,然后在向字符串中添加每一行后忘记添加换行符?