I'm not totally sure `mapred.output.dir` is going to be set always here. It might be safer for this one to just only do it the format is a FileOutputFormat (e.g. check if the output format is instanceof FileOutputFormat). Then get the path by casting it to a FileOutputFormat and calling getOutputPath. That seems a bit safer to me.