Added check before append review stats file.
This commit is contained in:
parent
47a92976f8
commit
7e905380f8
@ -65,12 +65,15 @@ public class ReviewDatasFile
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String line = String.format("%s\t%d\t%d", stat.getDate().format(DateTimeFormatter.ofPattern("yyyyMMdd-hh'h'mm")), stat.getUserCount(),
|
if ((file != null) && (file.exists()))
|
||||||
stat.getDuration());
|
{
|
||||||
|
String line = String.format("%s\t%d\t%d", stat.getDate().format(DateTimeFormatter.ofPattern("yyyyMMdd-hh'h'mm")), stat.getUserCount(),
|
||||||
|
stat.getDuration());
|
||||||
|
|
||||||
StringList lines = StringsUtils.load(file);
|
StringList lines = StringsUtils.load(file);
|
||||||
lines.add(line);
|
lines.add(line);
|
||||||
StringsUtils.save(file, lines);
|
StringsUtils.save(file, lines);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException exception)
|
catch (FileNotFoundException exception)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user