/**
   * Takes a file from the HDFS and moves it into the local file system.
   *
   * @param source the {@link String} representation of the file source file and its path in the
   *     HDFS
   * @param dest the {@link String} representation of the destination directory in the local file
   *     system.
   * @throws IOException
   */
  public void moveFromHdfs(String source, String dest) throws IOException {

    Path srcPath = new Path(source);
    Path dstPath = new Path(dest);

    // Get the filename out of the file path
    String filename = srcPath.getName();

    fileSystem.moveToLocalFile(srcPath, dstPath);
    System.out.println("File " + filename + " moved to " + dest);
  }