|
@@ -35,6 +35,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import sun.misc.BASE64Decoder;
|
|
import sun.misc.BASE64Decoder;
|
|
|
|
|
|
|
|
|
|
+import javax.imageio.ImageIO;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.sql.rowset.serial.SerialBlob;
|
|
import javax.sql.rowset.serial.SerialBlob;
|
|
|
import javax.sql.rowset.serial.SerialException;
|
|
import javax.sql.rowset.serial.SerialException;
|
|
@@ -432,6 +433,23 @@ public class OssServiceImpl implements OssService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void fileDownloadLocal(String key, String localPath) {
|
|
|
|
|
+ OSSObject ossObject = ossClient.getObject(ALIYUN_OSS_BUCKET_NAME, key);
|
|
|
|
|
+ InputStream in = ossObject.getObjectContent();
|
|
|
|
|
+ try {
|
|
|
|
|
+ OutputStream out = new FileOutputStream(localPath);
|
|
|
|
|
+ int data;
|
|
|
|
|
+ while ((data=in.read())!=-1){
|
|
|
|
|
+ out.write(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ out.close();
|
|
|
|
|
+ in.close();
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public void zipFile(List<String> fileList, ZipOutputStream zipOut,String dir) {
|
|
public void zipFile(List<String> fileList, ZipOutputStream zipOut,String dir) {
|
|
|
if (CollectionUtils.isEmpty(fileList)) {
|
|
if (CollectionUtils.isEmpty(fileList)) {
|
|
|
return;
|
|
return;
|