package com.example.demo; import lombok.experimental.UtilityClass; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @UtilityClass public class FileUtils { public static Long getLines(String filePath) throws IOException { Path path = Paths.get(filePath); Long count = Files.lines(path).count(); return count; } }
No comments:
Post a Comment