Better use of WebAppContext.getResourceFactory()

This commit is contained in:
Joakim Erdfelt 2022-10-17 15:15:05 -05:00
parent 0e25d98a9d
commit 81b1a6688d
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
2 changed files with 4 additions and 4 deletions

View File

@ -178,7 +178,7 @@ public abstract class AbstractUnassembledWebAppMojo extends AbstractWebAppMojo
Resource r = webApp.getResourceFactory().newResource(webXml.toPath()); Resource r = webApp.getResourceFactory().newResource(webXml.toPath());
if (r.exists() && !r.isDirectory()) if (r.exists() && !r.isDirectory())
{ {
webApp.setDescriptor(r.toString()); webApp.setDescriptor(r.getURI().toASCIIString());
} }
} }
@ -190,7 +190,7 @@ public abstract class AbstractUnassembledWebAppMojo extends AbstractWebAppMojo
Resource r = webApp.getBaseResource().resolve("WEB-INF/web.xml"); Resource r = webApp.getBaseResource().resolve("WEB-INF/web.xml");
if (r.exists() && !r.isDirectory()) if (r.exists() && !r.isDirectory())
{ {
webApp.setDescriptor(r.toString()); webApp.setDescriptor(r.getURI().toASCIIString());
} }
} }

View File

@ -166,10 +166,10 @@ public abstract class AbstractUnassembledWebAppMojo extends AbstractWebAppMojo
//Has an explicit web.xml file been configured to use? //Has an explicit web.xml file been configured to use?
if (webXml != null) if (webXml != null)
{ {
Resource r = ResourceFactory.root().newResource(webXml.toPath()); Resource r = webApp.getResourceFactory().newResource(webXml.toPath());
if (r.exists() && !r.isDirectory()) if (r.exists() && !r.isDirectory())
{ {
webApp.setDescriptor(r.toString()); webApp.setDescriptor(r.getURI().toASCIIString());
} }
} }