I am searching for a .txt file that is located at change set. Then I need to create locally over my pc the full path directory of this file.
For example if there a file called"test.txt" that it's located at: Project1-->Folder1-->Folder2-->test.txt
Till now I have managed to search for this file. Now I need to fetch the full directory and create similar one over my pc: Result at my pc: Folder1-->Folder2-->test.txt
That's what I did to search for the file within a changeset and retrieve it:
public IFileItem getTextFileFile(IChangeSet changeSet, ITeamRepository repository) throws TeamRepositoryException{
IVersionableManager vm = SCMPlatform.getWorkspaceManager(repository).versionableManager();
List changes = changeSet.changes();
IFileItem toReturn = null;
for(int i=0;i<changes.size();i++) {="" <br=""> Change change = (Change) changes.get(i);
IVersionableHandle after = change.afterState();
if( after != null && after instanceof IFileItemHandle) {
IFileItem fileItem = (IFileItem) vm.fetchCompleteState(after, null);
if(fileItem.getName().contains(".txt")) {
toReturn = fileItem;
break;
} else {
continue;
}
}
}
if(toReturn == null){
throw new TeamRepositoryException("Could not find the file");
}
return toReturn;
}
I have searched & posted at the forums and most of things I found is that I can use: configuration.determineAncestorsInHistory
However in order to get the IConfiguration,I need for workspaceConnection which is not valid at my case.
Thanks.
I use RTC:4 Win:XP
Thanks in advance.