It's all about the answers!

Ask a question

How to get the files from a Null versionhandle ??


vinitha dsouza (147223136) | asked Apr 05 '18, 5:02 a.m.

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 ??

Accepted answer


permanent link
David Lafreniere (4.8k7) | answered Jan 11 '19, 3:31 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
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

One other answer



permanent link
Ralph Schoon (63.5k33646) | answered Apr 05 '18, 10:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

My best guess, you can't.

Your answer


Register or 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.