Saturday, November 22, 2014

read from a file in Java

<%@page import="java.nio.file.Files"%>
<%@page import="java.nio.file.Path"%>

 
 

...imagine more code here and then...

 
 

if(isDescription) {
   Path descriptionPath = Paths.get(location + description + extension);
   for (String descriptionLine: Files.readAllLines(descriptionPath)){
      descriptionContents = descriptionContents + descriptionLine;
   }
}
%>

No comments:

Post a Comment