|
@@ -8,6 +8,7 @@ import kd.bos.service.attachment.FilePathService;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 自定义附件服务
|
|
* 自定义附件服务
|
|
@@ -49,4 +50,19 @@ public class CusFileServiceExt extends FilePathService {
|
|
return in;
|
|
return in;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public InputStream beforeWriteToResponse(String originalPath, InputStream in, String userAgent) {
|
|
|
|
+ logger.info("--------------beforeWriteToResponse测试 "+originalPath+"----------------");
|
|
|
|
+
|
|
|
|
+ if("preview".equals(userAgent)){
|
|
|
|
+ in = FileSECUtils.processFileWithSEC(originalPath, in);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return super.beforeWriteToResponse(originalPath, in, userAgent);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, Object> beforeWrite(String originalPath, InputStream in, String userAgent, Map<String, Object> params) {
|
|
|
|
+ return super.beforeWrite(originalPath, in, userAgent, params);
|
|
|
|
+ }
|
|
}
|
|
}
|