How to know if a file/item in RTC is deleted or not by knowing UUID(itemid) or UUID+stateid both
I have the item id and state id a file and i fetch the versionable as below
IVersionableHandle versionableHandle = (IVersionableHandle) type.createItemHandle(UUID.valueOf(file2ItemUuid), UUID.valueOf(file2StateUuid));
IFileItem fileItem = (IFileItem) SCMPlatform.getWorkspaceManager (teamRepository).versionableManager(). fetchCompleteState(versionableHandle, new NullProgressMonitor());
IFileItem fileItem = (IFileItem) SCMPlatform.getWorkspaceManager (teamRepository).versionableManager(). fetchCompleteState(versionableHandle, new NullProgressMonitor());
But how can I identify if the fileitem is already deleted or not , because the above queries fetch the content of a file even when its already deleted from ALM streams.
One answer
Note: A file can be deleted in StreamA, and not deleted in StreamB, thus in order to answer your question, you need a context/configuration.
You can look at IWorkspaceConnection API.
You can try:
IWorkspaceConnection.changeHistory(<componentYouCareAbout>).getHistoryFile(versionableHandle...) - If the last change set contains that file, and if the 'after state' of that file is null, then it was deleted
or
or
IWorkspaceConnection.configuration().fetchCompleteItems(...), if we have non-null states, and then a null state, then the file was deleted in that configuration.