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

How to get the files from a Null versionhandle ??

Hello Team

Usecase : I am deleting the file from a changeset
How do i get the deleted file name from a null versionhandle ??

IConfiguration configuration = tempWSConnection.configuration(component);
                    List changesFilesList = changeSet.changes();
                    for (Object changedFileObj : changesFilesList) {
                        Change changedFile = (Change) changedFileObj;
                        versionableHandle = changedFile.afterState();
                        filesToSearch.clear();
                        System.out.println(versionableHandle);
                        if (null != versionableHandle) {
                            filesToSearch.add(versionableHandle);
                            ancestor = configuration.locateAncestors(filesToSearch, monitor);
                    }

In this above code i get the versionableHandle as null for the deleted file ,How do i get the file name from this ??

0 votes


Accepted answer

Permanent link
In a file deletion scenario, normally the after state is null, but the before state is non-null... you just need to fetch the state that is not null to get the name of the file. (Note: It's possible for the before state to be null as well in merge scenarios, so you may need to look at the merge states).
Ralph Schoon selected this answer as the correct answer

0 votes


One other answer

Permanent link

My best guess, you can't.

0 votes

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,937

Question asked: Apr 05 '18, 5:02 a.m.

Question was seen: 1,809 times

Last updated: Jan 11 '19, 3:31 p.m.

Confirmation Cancel Confirm