> For the complete documentation index, see [llms.txt](https://avbravo-2.gitbook.io/trucosjakartaee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://avbravo-2.gitbook.io/trucosjakartaee/leer-archivos-en-una-linea-de-codigo.md).

# Leer archivos en una linea de codigo

{% embed url="<http://adambien.blog/roller/abien/entry/java_11_read_a_file>" %}

```
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;    

@Test
public void readFileIntoString() throws IOException {
    String content = Files.readString(Paths.get("[FILE_NAME]"));
    assertNotNull(content);
}    
```
