We are implementing Storage Extension. Using 2013 SP1.
"remove" method is invoked while unpublishing an item. This method is also invoked while republishing an already published item (and then "create" method is invoked. This is strange as one would expect update method to be invoked instead of remove and create. Apparently this is a known behavior as I see in How do I get my Storage Extension to call the 'update' method when republishing a Dynamic Component Presentation?).
How can I find out within the "remove" method if it is invoked in the context of unpublishing or republishing? We have got a reason why we need to differentiate these 2 in the remove method.