Cm 002

pull for 4.2

@Micha -- please see if this makes sense to you as an internal class in ResourceUtil.  if not we can move it elsewhere.