code: public <X> DataSource<X> readFile(FileInputFormat<X> inputFormat, String filePath) {
  		if (inputFormat == null) {
  			throw new IllegalArgumentException("InputFormat must not be null.");
  		}
  		if (filePath == null) {
  			throw new IllegalArgumentException("The file path must not be null.");
  		}
  
  		inputFormat.setFilePath(new Path(filePath));
  		try {
  			return createInput(inputFormat, TypeExtractor.getInputFormatTypes(inputFormat));
  		}
  		catch (Exception e) {
  			throw new InvalidProgramException("The type returned by the input format could not be automatically determined. " +
  					"Please specify the TypeInformation of the produced type explicitly by using the " +
  					"'createInput(InputFormat, TypeInformation)' method instead.");
  		}
  	}
docs: ------------------------------------ File Input Format -----------------------------------------