How can I get changed content of modified file using RTC-SDK
When I deliver a changeset, I have get the changeset and IVersionable.
Now I want to get how to get the changed content of file.
Below is source to get IVersionable :
IVersionableHandle versionableHandle = change.afterState();
ServiceConfigurationProvider configProvider = ServiceConfigurationProvider.FACTORY.create(
data.getDestWorkspace(), changeSet.getComponent());
IVersionable item = (IVersionable) scmService.fetchState(versionableHandle, null, null);
One answer
I do the following to download a file from the repository:
FileOutputStream outputFile = new FileOutputStream(destinationFile);
IConfiguration c = iWorkspaceConnection.configuration(componentHandle);
IFileItem fileItem = (IFileItem) c.fetchCompleteItem(versionableHandle, null);
IFileContent content = fileItem.getContent();
IFileContentManager contentManager = FileSystemCore.getContentManager(iTeamRepository);
contentManager.retrieveContent(fileItem, content, outputFile, null);
Hope this help you.