Commit 8a1edff7 authored by liqin's avatar liqin 💬

bug fixed

parent b5033092
......@@ -25,6 +25,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
......@@ -159,11 +161,11 @@ public class AssetController extends BaseController {
final String cipher = RandomUtil.randomString(BASE_STRING, 16);
for (final Asset asset : assetList) {
final String fileUrl = asset.getFileUrl();
ByteOutputStream byteOutputStream = new ByteOutputStream();
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
FastDFSUtils.downloadFile(fileUrl, byteOutputStream);
final Set<MetaData> fileMetaData = FastDFSUtils.getFileMetaData(fileUrl);
String fileName = fileMetaData.stream().filter(x -> "MD5".equals(x.getName())).map(MetaData::getValue).findFirst().get() + ".chnmuseum";
map.put(fileName, VideoEncryptUtil.encrypt(byteOutputStream.newInputStream(), cipher));
map.put(fileName, VideoEncryptUtil.encrypt(new ByteArrayInputStream(byteOutputStream.toByteArray()), cipher));
}
map.put("23432423432.key", null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment