try {
String [] filePathSplit = filePath.split("/");
String dictCode="FilePathFromTBPM";
ListDictByCodePo listDictByCodePo = new ListDictByCodePo();
listDictByCodePo.setDictCode(dictCode);
BaseResult<SysDictVo> sysDictVoResult = fileCenterService.listDictByCode(listDictByCodePo);
String configPath = sysDictVoResult.getData().getPath();
log.info("配置的TBPM文件路径:"+configPath);
String fileName = System.currentTimeMillis()+"."+fileType;
String tempPath = "/home/SiteSelection/Temp/";
String downLoadPath = tempPath+fileName;
// 文件完整路径
String fullPath = configPath.concat("/").concat(filePath);
//cp命令复制文件
log.info("复制文件开始");
Process process =null;
String cpCommand = "cp " +" "+ fullPath+" "+downLoadPath;
process = Runtime.getRuntime().exec(cpCommand);
log.info(IOUtils.toString(process.getInputStream()));//坑点:这个加入的作用相当于 在linux命令行敲入回车键
process.destroy();
log.info("复制文件结束");
log.info("开始下载附件文件: " + downLoadPath);
long start = System.currentTimeMillis();
PhotoUtil.downloadPhoto(downLoadPath, response,fileName);
log.info("附件文件: " + downLoadPath + " 下载完成, 耗时: " + (System.currentTimeMillis() - start));
log.info("获取附件文件请求结束");
//删除临时文件
log.info("删除文件开始");
FileUtils.forceDelete(new File(downLoadPath));
log.info("删除文件结束");
} catch (Exception e) {
log.error("获取附件文件失败:" + e.getMessage(), e);
throw new Exception("获取附件文件失败!");
}