ftp路径前多拼接了/导致文件找不到
This commit is contained in:
parent
cadbdb3ba9
commit
941c6c0685
|
@ -3208,7 +3208,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
try {
|
try {
|
||||||
sampleTmp = new File(fileAnlyse.getTmpFilePath());
|
sampleTmp = new File(fileAnlyse.getTmpFilePath());
|
||||||
if (Objects.nonNull(sampleTmp)) {
|
if (Objects.nonNull(sampleTmp)) {
|
||||||
bRet = ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + middleData.analyses_save_filePath.substring(0, middleData.analyses_save_filePath.lastIndexOf(StringPool.SLASH)), middleData.analyses_save_filePath.substring(middleData.analyses_save_filePath.lastIndexOf(StringPool.SLASH)+1), new FileInputStream(sampleTmp));
|
bRet = ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + middleData.analyses_save_filePath.substring(0, middleData.analyses_save_filePath.lastIndexOf(StringPool.SLASH)), middleData.analyses_save_filePath.substring(middleData.analyses_save_filePath.lastIndexOf(StringPool.SLASH)+1), new FileInputStream(sampleTmp));
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
|
@ -257,6 +257,10 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (Objects.nonNull(file)) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return struct;
|
return struct;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
result.error500("The comparison file path does not exist");
|
result.error500("The comparison file path does not exist");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
compareFilePath = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + compareFilePath;
|
compareFilePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + compareFilePath;
|
||||||
File compareFile = ftpUtil.downloadFile(compareFilePath, "betaGamma");
|
File compareFile = ftpUtil.downloadFile(compareFilePath, "betaGamma");
|
||||||
if (Objects.isNull(compareFile)) {
|
if (Objects.isNull(compareFile)) {
|
||||||
result.error500("The comparison file path does not exist");
|
result.error500("The comparison file path does not exist");
|
||||||
|
@ -1086,7 +1086,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
result.error500("The comparison file path does not exist");
|
result.error500("The comparison file path does not exist");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
stripFilePath = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + stripFilePath;
|
stripFilePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + stripFilePath;
|
||||||
File stripFile = ftpUtil.downloadFile(stripFilePath, "betaGamma");
|
File stripFile = ftpUtil.downloadFile(stripFilePath, "betaGamma");
|
||||||
if (Objects.isNull(stripFile)) {
|
if (Objects.isNull(stripFile)) {
|
||||||
result.error500("The comparison file path does not exist");
|
result.error500("The comparison file path does not exist");
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
String userName = JwtUtil.getUserNameByToken(request);
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
//解析文件
|
//解析文件
|
||||||
//上传文件路径
|
//上传文件路径
|
||||||
String path = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
String path = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
||||||
//获取自建台站缓存信息
|
//获取自建台站缓存信息
|
||||||
Cache<String, SelfStationData> selfCache = selfStationCache.getSelfCache();
|
Cache<String, SelfStationData> selfCache = selfStationCache.getSelfCache();
|
||||||
SelfStationData selfStationData = selfCache.getIfPresent(sampleFileName + StringPool.DASH + userName);
|
SelfStationData selfStationData = selfCache.getIfPresent(sampleFileName + StringPool.DASH + userName);
|
||||||
|
|
|
@ -431,7 +431,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
List<String> filePaths = new LinkedList<>();
|
List<String> filePaths = new LinkedList<>();
|
||||||
//判断sample信息是否存在
|
//判断sample信息是否存在
|
||||||
if (Objects.nonNull(sample)) {
|
if (Objects.nonNull(sample)) {
|
||||||
betaDataFile.setSampleFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getSampleFilePath());
|
betaDataFile.setSampleFilePathName(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getSampleFilePath());
|
||||||
betaDataFile.setSampleFileName(sampleFileName);
|
betaDataFile.setSampleFileName(sampleFileName);
|
||||||
sampleTmp = ftpUtil.downloadFile(betaDataFile.getSampleFilePathName(), "betaGamma");
|
sampleTmp = ftpUtil.downloadFile(betaDataFile.getSampleFilePathName(), "betaGamma");
|
||||||
if (Objects.nonNull(sampleTmp)) {
|
if (Objects.nonNull(sampleTmp)) {
|
||||||
|
@ -445,7 +445,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
}
|
}
|
||||||
//判断gas信息是否存在
|
//判断gas信息是否存在
|
||||||
if (Objects.nonNull(gasBg)) {
|
if (Objects.nonNull(gasBg)) {
|
||||||
betaDataFile.setGasFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getGasBgFilePath());
|
betaDataFile.setGasFilePathName(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getGasBgFilePath());
|
||||||
betaDataFile.setGasFileName(gasFileName);
|
betaDataFile.setGasFileName(gasFileName);
|
||||||
gasTmp = ftpUtil.downloadFile(betaDataFile.getGasFilePathName(), "betaGamma");
|
gasTmp = ftpUtil.downloadFile(betaDataFile.getGasFilePathName(), "betaGamma");
|
||||||
if (Objects.nonNull(gasTmp)) {
|
if (Objects.nonNull(gasTmp)) {
|
||||||
|
@ -459,7 +459,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
}
|
}
|
||||||
//判断det信息是否存在
|
//判断det信息是否存在
|
||||||
if (Objects.nonNull(detBg)) {
|
if (Objects.nonNull(detBg)) {
|
||||||
betaDataFile.setDetFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getDetBgFilePath());
|
betaDataFile.setDetFilePathName(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getDetBgFilePath());
|
||||||
betaDataFile.setDetFileName(detFileName);
|
betaDataFile.setDetFileName(detFileName);
|
||||||
detTmp = ftpUtil.downloadFile(betaDataFile.getDetFilePathName(), "betaGamma");
|
detTmp = ftpUtil.downloadFile(betaDataFile.getDetFilePathName(), "betaGamma");
|
||||||
if (Objects.nonNull(detTmp)) {
|
if (Objects.nonNull(detTmp)) {
|
||||||
|
@ -473,7 +473,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
}
|
}
|
||||||
//判断qc信息是否存在
|
//判断qc信息是否存在
|
||||||
if (Objects.nonNull(qc)) {
|
if (Objects.nonNull(qc)) {
|
||||||
betaDataFile.setQcFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbQcFilePath);
|
betaDataFile.setQcFilePathName(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbQcFilePath);
|
||||||
betaDataFile.setQcFileName(qcFileName);
|
betaDataFile.setQcFileName(qcFileName);
|
||||||
qcTmp = ftpUtil.downloadFile(betaDataFile.getQcFilePathName(), "betaGamma");
|
qcTmp = ftpUtil.downloadFile(betaDataFile.getQcFilePathName(), "betaGamma");
|
||||||
if (Objects.nonNull(qcTmp)) {
|
if (Objects.nonNull(qcTmp)) {
|
||||||
|
@ -552,7 +552,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
//获取用户名
|
//获取用户名
|
||||||
String userName = JwtUtil.getUserNameByToken(request);
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
//上传文件路径
|
//上传文件路径
|
||||||
String path = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
String path = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
Map<String, Object> sampleMap = new HashMap<>();
|
Map<String, Object> sampleMap = new HashMap<>();
|
||||||
Map<String, Object> gasBgMap = new HashMap<>();
|
Map<String, Object> gasBgMap = new HashMap<>();
|
||||||
|
@ -832,7 +832,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
InputStream inputStream = null;
|
InputStream inputStream = null;
|
||||||
ServletOutputStream outputStream = null;
|
ServletOutputStream outputStream = null;
|
||||||
try {
|
try {
|
||||||
inputStream = ftpUtil.downloadFileStream(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath + ".txt");
|
inputStream = ftpUtil.downloadFileStream(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath + ".txt");
|
||||||
if (Objects.nonNull(inputStream)){
|
if (Objects.nonNull(inputStream)){
|
||||||
outputStream = response.getOutputStream();
|
outputStream = response.getOutputStream();
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
|
@ -3676,7 +3676,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
InputStream inputStream = null;
|
InputStream inputStream = null;
|
||||||
ServletOutputStream outputStream = null;
|
ServletOutputStream outputStream = null;
|
||||||
try {
|
try {
|
||||||
inputStream = ftpUtil.downloadFileStream(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath);
|
inputStream = ftpUtil.downloadFileStream(ftpUtil.getFtpRootPath() + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath);
|
||||||
if (Objects.nonNull(inputStream)){
|
if (Objects.nonNull(inputStream)){
|
||||||
outputStream = response.getOutputStream();
|
outputStream = response.getOutputStream();
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
|
@ -3964,19 +3964,19 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
try {
|
try {
|
||||||
if (StringUtils.isNotBlank(betaDataFile.getSampleTmpPath())) {
|
if (StringUtils.isNotBlank(betaDataFile.getSampleTmpPath())) {
|
||||||
File sampleTmp = new File(betaDataFile.getSampleTmpPath());
|
File sampleTmp = new File(betaDataFile.getSampleTmpPath());
|
||||||
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + sampleFilePathName.substring(0, sampleFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getSampleFileName(), new FileInputStream(sampleTmp));
|
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + sampleFilePathName.substring(0, sampleFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getSampleFileName(), new FileInputStream(sampleTmp));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(betaDataFile.getGasTmpPath())) {
|
if (StringUtils.isNotBlank(betaDataFile.getGasTmpPath())) {
|
||||||
File gasTmp = new File(betaDataFile.getGasTmpPath());
|
File gasTmp = new File(betaDataFile.getGasTmpPath());
|
||||||
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + gasFilePathName.substring(0, gasFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getGasFileName(), new FileInputStream(gasTmp));
|
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + gasFilePathName.substring(0, gasFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getGasFileName(), new FileInputStream(gasTmp));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(betaDataFile.getDetTmpPath())) {
|
if (StringUtils.isNotBlank(betaDataFile.getDetTmpPath())) {
|
||||||
File detTmp = new File(betaDataFile.getDetTmpPath());
|
File detTmp = new File(betaDataFile.getDetTmpPath());
|
||||||
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + detFilePathName.substring(0, detFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getDetFileName(), new FileInputStream(detTmp));
|
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + detFilePathName.substring(0, detFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getDetFileName(), new FileInputStream(detTmp));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(betaDataFile.getQcTmpPath())) {
|
if (StringUtils.isNotBlank(betaDataFile.getQcTmpPath())) {
|
||||||
File qcTmp = new File(betaDataFile.getQcTmpPath());
|
File qcTmp = new File(betaDataFile.getQcTmpPath());
|
||||||
ftpUtil.saveFile(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + qcFilePathName.substring(0, qcFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getQcFileName(), new FileInputStream(qcTmp));
|
ftpUtil.saveFile(ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + qcFilePathName.substring(0, qcFilePathName.lastIndexOf(StringPool.SLASH)), anlyseResultIn.getQcFileName(), new FileInputStream(qcTmp));
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user