title: How to properly use readAllLines in Java?
body: <p>I am trying to read every line in a file and then splitting them. It is the first time I do this and I am not sure if I am using the right Charset or path to the file. Thank you for your help! Here is my try:   </p>
  
  <p>The path (ruta) in main is specified like this:</p>
  
  <pre><code>Path ruta=FileSystems.getDefault().getPath("mapa.csv");
  </code></pre>
  
  <p>The name of my file is mapa.csv, I am trying to get to its folder. The constructor is the following: </p>
  
  <pre><code>public void construirMapa() {
      List&lt;String&gt; lineas = null;   
      try{
          //this returns null
          lineas = Files.readAllLines(ruta, Charset.defaultCharset());  
      }catch(IOException ex){
          System.out.println(ex.getMessage());
      }
      if(lineas!=null){
          Iterator &lt;String&gt; linea=lineas.iterator();
          while(linea.hasNext()){
              String[] atributo=linea.next().split(";");
          }
      }
  }
  </code></pre>