From 61ad96e942f77de250e502f956a6051abf1eb55e Mon Sep 17 00:00:00 2001 From: srosse <none@none> Date: Sat, 25 Feb 2017 08:01:27 +0100 Subject: [PATCH] OO-2545: check if the file itself is writeable --- src/main/java/org/olat/restapi/system/MonitoringModule.java | 2 ++ src/main/java/org/olat/restapi/system/SamplerJob.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/org/olat/restapi/system/MonitoringModule.java b/src/main/java/org/olat/restapi/system/MonitoringModule.java index 7729c843a31..798d1c4c174 100644 --- a/src/main/java/org/olat/restapi/system/MonitoringModule.java +++ b/src/main/java/org/olat/restapi/system/MonitoringModule.java @@ -89,6 +89,8 @@ public class MonitoringModule extends AbstractSpringModule implements ConfigOnOf if(!parent.exists() || !parent.canWrite()) { log.warn("Cannot write proc file: " + xmlFile); } + } else if (!xmlFile.canWrite()) { + log.warn("Cannot write proc file: " + xmlFile); } } } diff --git a/src/main/java/org/olat/restapi/system/SamplerJob.java b/src/main/java/org/olat/restapi/system/SamplerJob.java index fd4d722a34d..20a84a76b1c 100644 --- a/src/main/java/org/olat/restapi/system/SamplerJob.java +++ b/src/main/java/org/olat/restapi/system/SamplerJob.java @@ -75,6 +75,8 @@ public class SamplerJob extends QuartzJobBean { if(!parent.exists() || !parent.canWrite()) { return; } + } else if(!xmlFile.canWrite()) { + return; } Statistics statistics = CoreSpringFactory.getImpl(MonitoringService.class).getStatistics(); -- GitLab