How to use RTC load rule excludeFilter
![](http://jazz.net/_images/myphoto/99f5380903f9ef16c459cfe09bc838d5.jpg)
Hi - I have a component that has directories like this:
root/fred/A/..
root/fred/B/..
root/fred/C/..
I'd like to load just /root/fred/A/.. in an eclipse workspace, that is - I want everything except root/fred/B/* and root/fred/C/*.
I've tried this:
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" eclipseProjectOptions="import" version="1">
<excludeFilter>
<filter name="root/fred/B" />
<filter name="root/fred/C" />
</excludeFilter>
<parentLoadRule>
<component name="C1"/>
<parentFolder repositoryPath="/"/>
<sandboxRelativePath includeRepositoryPath="true"/>
</parentLoadRule>
</scm:sourceControlLoadRule>
It just loads everything. Is there a way to do what I want? It looks as though excludeFilter should work (from this: https://jazz.net/library/article/1015) so I think I probably have the syntax wrong. Does anyone have an example?
I'm using the RTC V5.0 client.
Thanks, Zoe
root/fred/A/..
root/fred/B/..
root/fred/C/..
I'd like to load just /root/fred/A/.. in an eclipse workspace, that is - I want everything except root/fred/B/* and root/fred/C/*.
I've tried this:
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" eclipseProjectOptions="import" version="1">
<excludeFilter>
<filter name="root/fred/B" />
<filter name="root/fred/C" />
</excludeFilter>
<parentLoadRule>
<component name="C1"/>
<parentFolder repositoryPath="/"/>
<sandboxRelativePath includeRepositoryPath="true"/>
</parentLoadRule>
</scm:sourceControlLoadRule>
It just loads everything. Is there a way to do what I want? It looks as though excludeFilter should work (from this: https://jazz.net/library/article/1015) so I think I probably have the syntax wrong. Does anyone have an example?
I'm using the RTC V5.0 client.
Thanks, Zoe
One answer
![](http://jazz.net/_images/myphoto/99f5380903f9ef16c459cfe09bc838d5.jpg)
I believe the <excludefilter> considers only file or folder names. Your loadrule file is using a path instead. The filters "root/fred/B" and "root/fred/C" would not match any name and that is why everything is being loaded.You can try to use <itemLoadrule> instead.For example, the following load rule will load only folder /root/fred/A/ and the .project file at /root/fred (assuming this folder contains the .project file). If your .project file is at different location, you should also include that in the itemLoadRule, otherwise Eclipse project may not be created (the workspace should still be loaded in your sandbox.)<?xml version="1.0" encoding="UTF-8"?><scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" eclipseProjectOptions="import" version="1"><itemLoadRule><component name="C1"/><item repositoryPath="Fred/.project"/><sandboxRelativePath includeRepositoryPath="true"/></itemLoadRule><itemLoadRule><component name="C1"/><item repositoryPath="Fred/A"/><sandboxRelativePath includeRepositoryPath="true"/></itemLoadRule></scm:sourceControlLoadRule>
Comments
![](http://jazz.net/_images/myphoto/99f5380903f9ef16c459cfe09bc838d5.jpg)
So, if I had 100 folders and I wanted to load 98 and exclude 2, the only way to do this would be to list all 98 as items?
I can see that the other possibility is to put the ones that I don't want into another component but I was hoping to find a solution without doing this.
![](http://jazz.net/_images/myphoto/519a6e46a5db80475165c4815f71ab40.jpg)
In that case, you may have to specify the parent folder first using <parentFolder> tag -
<?xml version="1.0" encoding="UTF-8"?>
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" version="1">
<parentLoadRule>
<component name="C1"/>
<parentFolder repositoryPath="root/fred"/>
<exclude>
<filter name="B"/>
<filter name="C"/>
</exclude>
</parentLoadRule>
</scm:sourceControlLoadRule>