It's all about the answers!

Ask a question

programmatically forcing a load when directory based collisions occur


kanjbala jawahar (601815) | asked Jul 25 '12, 4:17 p.m.
Scenario:
Comp1 has following files:
adir\b.txt

Comp2 has following files:
adir\b.txt
adir\b2.txt

I load Comp1 first and then I load Comp2.

I want my workspace such that dir adir will contain both b.txt and b2.txt from Comp2.
I know there are collisions, but I want the load functionality to ignore them and force the load.
Is this doable? If it is, could you pls. provide some help with how I would go about it.

According to the ILoadOperation docs. this is not doable, unless I am misunderstanding.
Please respond as quickly as possible, we are in dire need of this functionality.

Thanks much.

Accepted answer


permanent link
Tim Mok (6.6k38) | answered Jul 26 '12, 8:14 a.m.
JAZZ DEVELOPER
This is handled by the dilemma handler given to the load operation. The handler requires several methods to be implemented and one of them is overlappingLoadRequests. This method should return IDilemmaHandler#CONTINUE in order to continue with the load.

All of the source control operations require a dilemma handler for these kinds of situations.

HTH
kanjbala jawahar selected this answer as the correct answer

Comments
kanjbala jawahar commented Jul 26 '12, 11:24 p.m.

Thanks Tim, I will try that out. I am using dilemma handler, but I am only overriding the collision method to not fail during overlap/overwrite. But that one was basically letting the load continue and not fail, but it was not actually adding to the dir or overwriting what was already there. And I needed it to go ahead and overwrite the existing contents (which I am finding using collidedWithExistingContent), and/or add to the dir if it finds new resources.

I will override overlappingLoadRequests as you suggest and see what I get.

Really appreciate the quick response. Thanks again.


Tim Mok commented Jul 30 '12, 2:15 p.m. | edited Jul 30 '12, 2:15 p.m.
JAZZ DEVELOPER

I think you are correct in overriding the collision method if shares on disk will collide with shares requested to be loaded. My suggestion about overlappingLoadRequests is mainly for shares requested to be loaded that overlap.

I'm not sure if continuing will still do what you want. I took a look at the operation and it doesn't look like the shares will be loaded (it isn't sure which one to load). It will log which ones weren't loaded due to overlap.

You might be able to load one component and then perform a second operation on the second component. It seems that will call the collision method. I think the continue here will still make the load go through and overwrite the existing share.

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.