|
@@ -2,7 +2,7 @@ package com.ozs.service.service.impl;
|
|
|
|
|
|
import com.ozs.common.utils.MinioUtils;
|
|
import com.ozs.common.utils.MinioUtils;
|
|
import com.ozs.common.utils.uuid.IdUtils;
|
|
import com.ozs.common.utils.uuid.IdUtils;
|
|
-import com.ozs.service.utils.FileUploader;
|
|
|
|
|
|
+import org.apache.poi.util.IOUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -24,8 +24,6 @@ public class CameraCaptureService {
|
|
private static final Logger log = LoggerFactory.getLogger(CameraCaptureService.class);
|
|
private static final Logger log = LoggerFactory.getLogger(CameraCaptureService.class);
|
|
@Resource
|
|
@Resource
|
|
MinioUtils minioUtils;
|
|
MinioUtils minioUtils;
|
|
- @Autowired
|
|
|
|
- FileUploader fileUploader;
|
|
|
|
|
|
|
|
public void getCapture(URL url, String fileName) throws IOException {
|
|
public void getCapture(URL url, String fileName) throws IOException {
|
|
HttpURLConnection connection = null;
|
|
HttpURLConnection connection = null;
|
|
@@ -76,9 +74,8 @@ public class CameraCaptureService {
|
|
log.debug("fileName"+fileName+"图片结束截图时间"+new Date());
|
|
log.debug("fileName"+fileName+"图片结束截图时间"+new Date());
|
|
}
|
|
}
|
|
String uploadUrl = "/data/test_picture/"+ IdUtils.fastSimpleUUID()+".jpeg";
|
|
String uploadUrl = "/data/test_picture/"+ IdUtils.fastSimpleUUID()+".jpeg";
|
|
- //File targetVideoDir = new File(uploadUrl);
|
|
|
|
- fileUploader.transfer(uploadUrl,bytes);
|
|
|
|
-
|
|
|
|
|
|
+ byteArrayInputStream.reset();
|
|
|
|
+ IOUtils.copy(byteArrayInputStream, new FileOutputStream(uploadUrl));
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
//先关闭外层的缓冲流,再关闭内层的流,但是在关闭外层流的同时,
|
|
//先关闭外层的缓冲流,再关闭内层的流,但是在关闭外层流的同时,
|