How to Create a New File in HDFS

  • FileSystem fs = FileSystem.get(conf);
    Path path= new Path("user/D/filelLocation/file.txt");
    fs.createNewFile(path);