MCPcopy Index your code
hub / github.com/OreosLab/bili / readFile

Method readFile

src/main/java/top/misec/utils/ReadFileUtils.java:25–40  ·  view source on GitHub ↗

读取指定路径的文件。 @return fileContentStr

(String filePath)

Source from the content-addressed store, hash-verified

23 * @return fileContentStr
24 */
25 public static String readFile(String filePath) {
26 String fileContentStr = null;
27 try {
28 InputStream inputStream = new FileInputStream(filePath);
29 int size = inputStream.available();
30 byte[] buffer = new byte[size];
31 inputStream.read(buffer);
32 inputStream.close();
33 fileContentStr = new String(buffer, StandardCharsets.UTF_8);
34 } catch (FileNotFoundException e) {
35 log.debug("file not found", e);
36 } catch (IOException e) {
37 log.warn("", e);
38 }
39 return fileContentStr;
40 }
41
42
43 /**

Callers 3

testMainHandlerMethod · 0.95
doServerPushMethod · 0.95
configInitMethod · 0.95

Calls 1

readMethod · 0.80

Tested by 1

testMainHandlerMethod · 0.76