|
@@ -156,8 +156,13 @@ public class DefaultPreviewCusServiceImpl implements PreviewService {
|
|
|
headerMap.put("preview.url", URLEncoder.encode(previewUrl, StandardCharsets.UTF_8.name()));
|
|
|
headerMap.put("preview.metaUrl", URLEncoder.encode(previewMetaUrl, StandardCharsets.UTF_8.name()));
|
|
|
Map<String, String> resHeader = new HashMap();
|
|
|
+
|
|
|
+ logger.info("testpreviewWPS...10001003下载");
|
|
|
+
|
|
|
in = this.fileService.download(path, headerMap, resHeader);
|
|
|
|
|
|
+ logger.info("testpreviewWPS...10001003解密");
|
|
|
+
|
|
|
in = FileSECUtils.processFileWithSEC(path, in);
|
|
|
|
|
|
endTime = System.currentTimeMillis();
|
|
@@ -229,13 +234,19 @@ public class DefaultPreviewCusServiceImpl implements PreviewService {
|
|
|
limitMax = Math.min(FileServiceConfig.PREVIEW_SIZE_LIMIT_MAX.getLong(), (Long)FileServiceConfig.PREVIEW_SIZE_LIMIT_MAX.getDefault());
|
|
|
long limit = Math.min(FileServiceConfig.PREVIEW_SIZE_LIMIT.getLong(), limitMax);
|
|
|
InputStream checkInputStream;
|
|
|
+
|
|
|
+ logger.info("getYunPanCovertRs...10001001");
|
|
|
+
|
|
|
if (temp) {
|
|
|
+ logger.info("getYunPanCovertRs...1000100111");
|
|
|
TempFileCache cache = CacheFactory.getCommonCacheFactory().getTempFileCache();
|
|
|
checkInputStream = cache.getInputStream(path);
|
|
|
} else {
|
|
|
checkInputStream = this.fileService.getInputStream(path);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ logger.info("getYunPanCovertRs...100010012");
|
|
|
checkInputStream = FileSECUtils.processFileWithSEC(path, checkInputStream);
|
|
|
|
|
|
boolean checkResult = checkFileSize(checkInputStream, fileName, limit == 0L ? limitMax : limit);
|
|
@@ -253,8 +264,14 @@ public class DefaultPreviewCusServiceImpl implements PreviewService {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
+ logger.info("getYunPanCovertRs...100010013");
|
|
|
+
|
|
|
in = this.yunPanConvert(path, fileName, userAgent, detail, temp);
|
|
|
+ logger.info("getYunPanCovertRs...100010014");
|
|
|
+
|
|
|
in = FileSECUtils.processFileWithSEC(path, in);
|
|
|
+
|
|
|
+
|
|
|
} catch (Exception var19) {
|
|
|
result = ExceptionUtil.setErrorInfo(var19.getMessage());
|
|
|
((Map)previewResult).put(PreviewParams.STATUS.getEnumName(), PreviewParams.ERROR.getEnumName());
|
|
@@ -363,7 +380,11 @@ public class DefaultPreviewCusServiceImpl implements PreviewService {
|
|
|
fileDownloadUrl = URLEncoder.encode(this.getDownloadUrl(URLEncoder.encode(path, StandardCharsets.UTF_8.name())), StandardCharsets.UTF_8.name());
|
|
|
}
|
|
|
|
|
|
+ logger.info("yunPanConvert...fileDownloadUrl" + fileDownloadUrl);
|
|
|
+
|
|
|
paramResult = ParameterUtil.concatUrl(uri, fileName, ext, fileDownloadUrl);
|
|
|
+
|
|
|
+ logger.info("yunPanConvert...paramResult" + paramResult.toString());
|
|
|
} catch (Exception var19) {
|
|
|
throw new KDException(BosErrorCode.previewFailed, new Object[]{BosRes.get("bos-fileservice-sdk", "DefaultPreviewServiceImpl_1", "filename或download_url encode出错:", new Object[0]) + var19});
|
|
|
}
|
|
@@ -391,6 +412,10 @@ public class DefaultPreviewCusServiceImpl implements PreviewService {
|
|
|
throw new KDException(BosErrorCode.previewFailed, new Object[]{BosRes.get("bos-fileservice-sdk", "DefaultPreviewServiceImpl_3", "从云盘中未获取到pdf流数据,pdf转换失败:", new Object[0])});
|
|
|
} else {
|
|
|
int statusCode = response.getStatusLine().getStatusCode();
|
|
|
+
|
|
|
+ logger.info("yunPanConvert...statusCode" + statusCode);
|
|
|
+ logger.info("yunPanConvert...response" + response.toString());
|
|
|
+
|
|
|
if (statusCode != 200) {
|
|
|
try {
|
|
|
if (isLog()) {
|