diff --git a/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java b/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java index 603c8858c8..f41ae93992 100644 --- a/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java +++ b/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java @@ -263,7 +263,9 @@ public OutputStream getOutputStream(boolean append) throws IOException { provider.lock(this); try { if (!super.exists() && !super.createNewFile()) { - throw new IOException("Can't create file [" + this + "]"); + // It's possible that another process (outside this JVM) has already created the file + // after our initial check, so we perform a double check before throwing an exception. + if (!super.exists()) throw new IOException("Can't create file [" + this + "]"); } return new BufferedOutputStream(new ResourceOutputStream(this, new FileOutputStream(this, append))); } diff --git a/loader/build.xml b/loader/build.xml index 8e3e9d2017..4c88b795dd 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 632c475cc5..613713c546 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.0.4.9-SNAPSHOT + 6.0.4.10-SNAPSHOT jar Lucee Loader Build