From bc354406679310db6a3fae5099ebf64271e1bc43 Mon Sep 17 00:00:00 2001 From: Emmanuel Hugonnet Date: Tue, 17 Dec 2024 17:46:31 +0100 Subject: [PATCH] [WFCORE-7102]: AccessDeniedException on Windows when using a read-only configuration dir. * Replacing java.io.File.canWrite() by java.nio.file.FIles.isWritable(Path). Jira: https://issues.redhat.com/browse/WFCORE-7102 Signed-off-by: Emmanuel Hugonnet --- .../jboss/as/controller/persistence/FilePersistenceUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/src/main/java/org/jboss/as/controller/persistence/FilePersistenceUtils.java b/controller/src/main/java/org/jboss/as/controller/persistence/FilePersistenceUtils.java index 3c2607c252a..61dbaa96e31 100644 --- a/controller/src/main/java/org/jboss/as/controller/persistence/FilePersistenceUtils.java +++ b/controller/src/main/java/org/jboss/as/controller/persistence/FilePersistenceUtils.java @@ -178,6 +178,6 @@ static boolean isParentFolderWritable(File file){ if ( !file.exists() || file.getParentFile() == null ){ return false; } - return file.getParentFile().canWrite(); + return Files.isWritable(file.getParentFile().toPath()); } }