private FileResource<?> getConfigFile(final Project project, final PackagingType type)
{
if (PackagingType.WAR.equals(type))
{
DirectoryResource webRoot = project.getFacet(WebResourceFacet.class).getWebRootDirectory();
return (FileResource<?>) webRoot.getChild("WEB-INF" + File.separator + "beans.xml");
}
else
{
DirectoryResource root = project.getFacet(ResourceFacet.class).getResourceFolder();
return (FileResource<?>) root.getChild("META-INF" + File.separator + "beans.xml");
}
}