如何\n
使用Unix 选择行尾java.nio.file.Files.write
?可能吗?我没有找到任何要选择的选项或常量。这是我的方法
import java.io.File;
//...
public void saveToFile(String absolutePath) {
File file = new File(path);
try {
Files.write(file.toPath(), lines/*List<String>*/, StandardCharsets.UTF_8, StandardOpenOption.CREATE, StandardOpenOption.APPEND);
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}