How to delete a file object in RTC Programatically using Java plain APIs ?
Hello Team,
I have a scenario, wherein I have to delete the file already present in RTC Stream. I need to delete a particular file, checkin as a changeset and then deliver the changeset with the deleted file. All this should be done using RTC APIs.
I already have code for creating the repo workspace for the stream. get the files from that components. now i need to delete some files.
Are there any APIs to delete the particular file already existing in stream ?
Thanks.
Accepted answer
I got the solution :
IConfigurationOpFactory opFactory = fRepoWsConn.configurationOpFactory();
opFactory.delete(foundItem);
Collection ops = new ArrayList();
ops.add(fRepoWsConn.configurationOpFactory().delete(foundItem));
IUpdateReport r = fRepoWsConn.commit(Collections.singletonList(getChangeSet("Deleting File")), Collections.singletonList(ops), null);
One other answer
https://jazz.net/library/article/1006 explains what can be deleted.
To find out what API that is, you could try to debug the Eclipse client. I had a quick look, but was unable to find the action at the moment.
Comments
Thanks for the reply Ralph,
we have the following code to file the IVersionable of the file.
Map<String, IVersionableHandle> handles = fConfiguration.childEntries( parentFolder, fMonitor);
IVersionableHandle foundHandle = handles.get(name);
if(null!=foundHandle){
return fConfiguration.fetchCompleteItem(foundHandle, fMonitor);
}
Is there any APIs to delete the file with this IVersionable or we also have the IFileItem of the file.
I found following API on searching in the RTC plugins :
com.ibm.team.filesystem.client.internal package : /**
* Deletes this storage object plus any children. The order in which the children are deleted
public abstract void delete(IProgressMonitor monitor) throws FileSystemException;
Could you pelase suggest on this.
Thanks