try {
List<VirtualFile> virtualFiles = root.getChildrenRecursively(WS_FILE_FILTER);
final Set<UnifiedVirtualFile> uVirtualFiles = new HashSet<UnifiedVirtualFile>();
for (VirtualFile vf : virtualFiles) {
// Adding the roots of the virtual files.
uVirtualFiles.add(new VirtualFileAdaptor(vf));
}
dep.setMetadataFiles(new LinkedList<UnifiedVirtualFile>(uVirtualFiles));
} catch (IOException e) {
this.log.warn("Could not load metadata files for deployment root " + root, e);
}
if (unit.getParent() != null) {
final String parentDeploymentName = unit.getParent().getName();
final Module parentModule = unit.getParent().getAttachment(Attachments.MODULE);
if (parentModule == null) {
throw new DeploymentUnitProcessingException("failed to resolve module for parent of deployment "
+ deploymentRoot);
}
final ClassLoader parentClassLoader = parentModule.getClassLoader();
this.log.debug("Creating new WS deployment model for parent: " + unit.getParent());
final ArchiveDeployment parentDep = this.newDeployment(parentDeploymentName, parentClassLoader);
dep.setParent(parentDep);
}
dep.setRootFile(new VirtualFileAdaptor(root));
dep.setRuntimeClassLoader(classLoader);
final DeploymentType deploymentType = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_TYPE_KEY);
dep.setType(deploymentType);
return dep;