MCPcopy Create free account
hub / github.com/Jarrettluo/all-docs / readFile

Method readFile

src/main/java/com/jiaruiblog/entity/FileObj.java:53–59  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

51
52
53 public void readFile(String path){
54 //读文件
55 File file = new File(path);
56 byte[] bytes = getContent(file);
57 //将文件内容转化为base64编码
58 this.content = Base64.getEncoder().encodeToString(bytes);
59 }
60
61 public void readFile(InputStream inputStream) {
62 byte[] bytes = getContent(inputStream);

Callers 2

uploadFileToEsMethod · 0.95
readFileByDirMethod · 0.95

Calls 1

getContentMethod · 0.95

Tested by

no test coverage detected