private List<LocalFSDesignResourceState> buildFSDesignResourceStates(IResource resource, IPath base) throws CoreException {
List<LocalFSDesignResourceState> states = new ArrayList<LocalFSDesignResourceState>();
if (resource instanceof IFolder && WGADesignStructureHelper.isDirlinkFolder((IFolder)resource)) {
// we have to resolve dirlink
IContainer dirlinkTarget = WGADesignStructureHelper.resolveDirLink(((IFolder)resource).getFile(WGUtils.DIRLINK_FILE));
if (dirlinkTarget != null && dirlinkTarget.isAccessible()) {
states.addAll(buildDirLinkFSDesignResourceStates(dirlinkTarget, resource.getName(), dirlinkTarget));
}
} else {
LocalFSDesignResourceState state = new LocalFSDesignResourceState();
states.add(state);
state.setFqPath(resource.getFullPath());
state.setPath(computeRelativPathFrom(resource, base).makeRelative().toString());
if (resource instanceof IContainer) {
state.setType(FSDesignResourceState.TYPE_FOLDER);
IContainer container = (IContainer) resource;
for (IResource child : container.members()) {
List<LocalFSDesignResourceState> childStates = buildFSDesignResourceStates(child, base);
states.addAll(childStates);
}
} else if (resource instanceof IFile) {
IFile file = (IFile) resource;