package com.bagri.tools.vvm.util;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Scanner;
public class FileUtil {
public static String readTextFile(String fileName) throws IOException {
Path path = Paths.get(fileName);
StringBuilder text = new StringBuilder();
try (Scanner scanner = new Scanner(path, "utf-8")) {
while (scanner.hasNextLine()) {
text.append(scanner.nextLine()).append("\n");
}
}
return text.toString();
}
public static String getFileName(String path) {
Path p = Paths.get(path);
return p.getFileName().toString();
}
}