I am using this method to read all text lines from a text file. But the method is reading just the first line. Any idea please!
And I am using the Java API Method Files.readAllLines()
public static String dateiEinlesen(String path, String name)
{
Path path = Paths.get(path, name);
Charset charset = Charset.forName("UTF-8");
try
{
List<String> lines = Files.readAllLines(path, charset);
for (String line : lines)
{
return line;
}
}
catch (IOException e)
{
}
return "File could not found! ";
}