code: public static <T, F extends FileOutputFormat<? extends T>> F openOutput(
  			Class<F> outputFormatClass, String path, Configuration configuration) 
  		throws IOException
  	{
  		final F outputFormat = ReflectionUtil.newInstance(outputFormatClass);
  		outputFormat.setOutputFilePath(new Path(path));
  		outputFormat.setOpenTimeout(0);
  		outputFormat.setWriteMode(WriteMode.OVERWRITE);
  	
  		configuration = configuration == null ? new Configuration() : configuration;
  		
  		outputFormat.configure(configuration);
  		outputFormat.open(0, 1);
  		return outputFormat;
  	}
docs: Creates an {@link OutputFormat} from a given class for the specified file. The optional {@link Configuration}
  initializes the format.
  
  @param <T>
  the class of the OutputFormat
  @param outputFormatClass
  the class of the OutputFormat
  @param path
  the path of the file or to the directory containing the splits
  @param configuration
  optional configuration of the OutputFormat
  @return the created {@link OutputFormat}
  @throws IOException
  if an I/O error occurred while accessing the file or initializing the OutputFormat.