title: How to get file content in java?
body: <p>to get the content of a txt file I usually use a scanner and iterate over each line to get the content:</p>
  
  <pre><code>Scanner sc = new Scanner(new File("file.txt"));
  while(sc.hasNextLine()){
      String str = sc.nextLine();                     
  }
  </code></pre>
  
  <p>Does the java api provide a way to get the content with one line of code like:</p>
  
  <pre><code>String content = FileUtils.readFileToString(new File("file.txt"))
  </code></pre>