我已经在AEM中安装了groovyconsole,并且我想将一些东西保存在文件中作为输出。
发帖this后,我尝试了:
<DataGrid ItemsSource="{Binding SensorDataTable}" SelectionMode="Extended" SelectionUnit="Cell">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="Yellow"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Converter={StaticResource SensorStatusConverter}}" Value="1">
<Setter Property="Background" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
</DataGrid>
我最终得到一个FileNotFoundException。我直接创建文件只是为了确保,但这也没有帮助。
对此有所了解。感谢。
答案 0 :(得分:0)
我建议您检查以下内容:
File.mkdirs()
来确保文件夹树存在,如下所示:def folderPath = "~/fff/eee/reports"
def folder = new File(folderPath)
def result =folder.mkdirs()
def filePath = "~/fff/eee/reports/output.csv"
File output = new File(filePath)
output.withWriterAppend{ out ->
out.println 'hello there!'
}