code: public static void writeInput(Configuration conf, Path inputDir) throws IOException {
          FileSystem fs = FileSystem.get(conf);
  
          if (fs.exists(inputDir)) {
              throw new IOException(String.format("Input directory '%s' exists - please remove and rerun this example", inputDir));
          }
  
          OutputStreamWriter writer = new OutputStreamWriter(fs.create(new Path(inputDir, "input.txt")));
          for (String name : EXAMPLE_NAMES) {
              writer.write(name);
          }
          IOUtils.closeStream(writer);
      }
docs: Writes the contents of {@link #EXAMPLE_NAMES} into a file in the job input directory in HDFS.
  
  @param conf     the Hadoop config
  @param inputDir the HDFS input directory where we'll write a file
  @throws IOException if something goes wrong