猿问

springboot集成FastDFS 下载功能怎么实现?

public static InputStream downFile(String groupName, String remoteFileName) {

try {

StorageClient storageClient = getTrackerClient();

byte[] fileByte = storageClient.download_file(groupName, remoteFileName);

InputStream ins = new ByteArrayInputStream(fileByte);

return ins;

} catch (IOException e) {

logger.error("IO Exception: Get File from Fast DFS failed", e);

} catch (Exception e) {

logger.error("Non IO Exception: Get File from Fast DFS failed", e);

}

return null;

}

这是我工具类里面下载功能,请问在控制台这边怎么实现下载?

涂红
浏览 2053回答 0
0回答
随时随地看视频慕课网APP

相关分类

Java
我要回答