src/main/constants/MoFunctions.java
// reads files from the given path
reads files from the given path
reads files from the given path
public static String readFile(String pathFile) throws IOException {
        Path path = Paths.get(pathFile);
        StringBuilder stringBuilder = new StringBuilder();
        for (String line: Files.readAllLines(path, StandardCharsets.UTF_8)) {
            if (!line.isEmpty()) {
                stringBuilder.append(line).append("\n");
            }
        }
        return stringBuilder.toString();
    }
public static String readFile ( String pathFile ) throws IOException { Path path = Paths . get ( pathFile ) ; StringBuilder stringBuilder = new StringBuilder ( ) ; for ( String line : Files . readAllLines ( path , StandardCharsets . UTF_8 ) ) { if ( ! line . isEmpty ( ) ) { stringBuilder . append ( line ) . append ( "\n" ) ; } } return stringBuilder . toString ( ) ; }
reads files from the given path
reads files from the given path
//byte[] bytes = Files.readAllBytes(path);