提交 a16d7fae authored 作者: zhangshuang's avatar zhangshuang

ftp文件服务器与配置文件修改

上级 da79ce93
...@@ -26,20 +26,9 @@ public class FileDownLoadServiceImpl implements FileDownLoadService { ...@@ -26,20 +26,9 @@ public class FileDownLoadServiceImpl implements FileDownLoadService {
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); e.printStackTrace();
} }
File sourceFile = new File(fileAddress); File file = new File(fileAddress + "/" + fileName);
boolean fileExist = false; boolean fileExist = false;
File[] files = sourceFile.listFiles();
if(files != null && files.length != 0){
for (File f:files){
if (f.getName().startsWith(fileName)){
fileName = f.getName();
fileExist = true;
break;
}
}
}
if(fileExist){ if(fileExist){
File file = new File(fileAddress + "/" + fileName);
setFileDownloadHeader(httpServletRequest,response,fileName); setFileDownloadHeader(httpServletRequest,response,fileName);
OutputStream os = null; OutputStream os = null;
InputStream is = null; InputStream is = null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论