There might be a helper method in `scala.tools.eclipse.resources` in `sdt.core` but it looks ok as is too.