It's all about the answers!

Ask a question

How can I get changed content of modified file using RTC-SDK

silencehill wu (5022532) | asked Nov 28 '12, 11:16 a.m.

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

permanent link
Martin Dam Pedersen (1352814) | answered Dec 05 '12, 5:36 a.m.
 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.

Your answer

Register or to post your answer.