|
@@ -1,10 +1,12 @@
|
|
|
package nckd.base.helper;
|
|
|
|
|
|
+import kd.bos.fileservice.FileServiceFactory;
|
|
|
import kd.bos.fileservice.extension.FileServiceExt;
|
|
|
import kd.bos.logging.Log;
|
|
|
import kd.bos.logging.LogFactory;
|
|
|
import kd.bos.service.attachment.FilePathService;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.InputStream;
|
|
|
|
|
|
public class CusFileServiceExt extends FilePathService implements FileServiceExt {
|
|
@@ -15,14 +17,18 @@ public class CusFileServiceExt extends FilePathService implements FileServiceExt
|
|
|
public InputStream encode(String originalPath, InputStream in) {
|
|
|
logger.info("--------------SEC 附件加密 "+originalPath+"----------------");
|
|
|
|
|
|
- return in;
|
|
|
+ long filesize = FileSECUtils.getFileSizeByPath(originalPath);
|
|
|
+ InputStream inForSEC = FileSECUtils.decodeFileForSEC(filesize,in);
|
|
|
+
|
|
|
+ return inForSEC;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public InputStream decode(String originalPath, InputStream in) {
|
|
|
logger.info("--------------SEC 附件解密 "+originalPath+"----------------");
|
|
|
-
|
|
|
- return in;
|
|
|
+ long filesize = FileSECUtils.getFileSizeByPath(originalPath);
|
|
|
+ InputStream inForSEC = FileSECUtils.decodeFileForSEC(filesize,in);
|
|
|
+ return inForSEC;
|
|
|
}
|
|
|
|
|
|
|