This looks like a rather roundabout way of doing something like `originalName.substring(0, originalName.lastIndexOf('.'))`?