From f1e000d4af3aee203753d31d184f8de262d3a86f Mon Sep 17 00:00:00 2001 From: Stefan Tataru Date: Wed, 27 Nov 2024 16:49:48 +0100 Subject: [PATCH] minor change --- .../web/service/jetty/internal/JettyServerWrapper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerWrapper.java b/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerWrapper.java index 1a31ddb130..38abdedce7 100644 --- a/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerWrapper.java +++ b/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerWrapper.java @@ -374,10 +374,12 @@ private void applyJettyConfiguration() throws Exception { if (emptyConfigFile != null) { // by default the file is not physically there if (!emptyConfigFile.createNewFile()) { - try (InputStream resourceStream = bundle.getResource(fileName).openStream(); - FileOutputStream fos = new FileOutputStream(emptyConfigFile)) { - resourceStream.transferTo(fos); - } + emptyConfigFile.delete(); + emptyConfigFile.createNewFile(); + } + try (InputStream resourceStream = bundle.getResource(fileName).openStream(); + FileOutputStream fos = new FileOutputStream(emptyConfigFile)) { + resourceStream.transferTo(fos); } URL emptyConfigURL = emptyConfigFile.toURL(); new XmlConfiguration(jettyFactory.newResource(emptyConfigURL));