It's all about the answers!

Ask a question

How to get the files from a Null versionhandle ??


vinitha dsouza (75737) | 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.1k7) | answered Jan 11, 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 (55.2k23642) | 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.