Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes


Accepted answer

Permanent link

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);
                    

David Lafreniere selected this answer as the correct answer

0 votes


One other answer

Permanent link

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.

1 vote

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

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 1,202

Question asked: Mar 07 '18, 2:54 a.m.

Question was seen: 3,395 times

Last updated: Mar 21 '18, 5:01 a.m.

Confirmation Cancel Confirm