if (resourceURL == null && getRootFile() != null)
{
try
{
UnifiedVirtualFile vfResource = getRootFile().findChild(resourcePath);
resourceURL = vfResource.toURL();
}
catch (IOException e)
{
if (metadataFiles == null || metadataFiles.isEmpty())
{
throw e;
}
else
{
log.debug("Cannot get " + resourcePath + " from root file, trying with additional metadata files", e);
}
}
}
//scan additional metadata files (for instance originally attached to a VFSDeploymentUnit)
if (resourceURL == null && metadataFiles != null && !metadataFiles.isEmpty())
{
UnifiedVirtualFile vfResource = null;
for (UnifiedVirtualFile metadataFile : getMetadataFiles())
{
try
{
UnifiedVirtualFile child = metadataFile.findChild(resourcePath);
if (child != null)
{
vfResource = child;
break;
}