XmlParser로 검사 한 후 텍스트 일부를 파일에 씁니다. 모두 잘 작동하지만 코드는 해당 파일을 닫지 마십시오. 그런 다음 프로그램에 문제가 있습니다. .tmp 파일을 만듭니다. 그 행동 후 내 파일은 얼마나 가까운가요?newOutputStream 파일 닫기
def path = new File("my/path"))
def xml = new XmlParser().parse(path)
xml.appendNode("include", [
myAppendToCheck"
])
XmlUtil.serialize(xml, path.newOutputStream())
path.newOutputStream().flush()
path.newOutputStream().close()
그건 아주 도움이, 난 여전히 Java에서 초보자입니다. 감사 :) –