use of org.eclipse.wst.common.componentcore.resources.IVirtualContainer in project webtools.sourceediting by eclipse.
the class ComponentDeployable method getMembers.
protected IModuleResource[] getMembers(IVirtualContainer cont, IPath path) throws CoreException {
IVirtualResource[] res = cont.members();
int size2 = res.length;
List<IModuleFile> list = new ArrayList<IModuleFile>(size2);
for (int j = 0; j < size2; j++) {
if (res[j] instanceof IVirtualContainer) {
IVirtualContainer cc = (IVirtualContainer) res[j];
// Retrieve already existing module folder if applicable
ModuleFolder mf = (ModuleFolder) getExistingModuleResource(members, path.append(new Path(cc.getName()).makeRelative()));
if (mf == null) {
mf = new ModuleFolder((IContainer) cc.getUnderlyingResource(), cc.getName(), path);
ModuleFolder parent = (ModuleFolder) getExistingModuleResource(members, path);
if (path.isEmpty())
members.add(mf);
else {
if (parent == null)
parent = ensureParentExists(path, (IContainer) cc.getUnderlyingResource());
addMembersToModuleFolder(parent, new IModuleResource[] { mf });
}
}
IModuleResource[] mr = getMembers(cc, path.append(cc.getName()));
addMembersToModuleFolder(mf, mr);
} else {
IFile f = (IFile) res[j].getUnderlyingResource();
IModuleFile mf = null;
if (shouldAddComponentFile(f)) {
mf = createModuleFile(f, path);
list.add(mf);
}
}
}
IModuleResource[] mr = new IModuleResource[list.size()];
list.toArray(mr);
return mr;
}
Aggregations