Get InputSplit on Context.
Cast it to FileSplit and getPath on thatPath filePath = ((FileSplit) context.getInputSplit()).getPath(); String filePathString = ((FileSplit) context.getInputSplit()).getPath().toString();
String fileName = ((FileSplit) context.getInputSplit()).getPath().getName();