Commit 33885f4f by zhangxk

修改ftp文件上传路径,图片和视频路径分开放

1 parent fc88bf28
...@@ -30,7 +30,10 @@ public interface Process { ...@@ -30,7 +30,10 @@ public interface Process {
LOGGER.error("", e); LOGGER.error("", e);
} }
fileName = StringUtil.subFileName(fileName); fileName = StringUtil.subFileName(fileName);
return "video/" + yyyyMMdd + "/12401/" + fileName; if(fileName.endsWith(".mp4") || fileName.endsWith("avi")){
return "video/" + yyyyMMdd + "/12401/" + fileName;
}
return "image/" + yyyyMMdd + "/12401/event/" + fileName;
} }
static byte[] downloadFile(String url) { static byte[] downloadFile(String url) {
......
...@@ -12,6 +12,9 @@ public class StringUtil { ...@@ -12,6 +12,9 @@ public class StringUtil {
* @param filename - * @param filename -
*/ */
public static String subFileName(String filename){ public static String subFileName(String filename){
if(filename == null){
return "";
}
int i = filename.lastIndexOf("/"); int i = filename.lastIndexOf("/");
filename = StringUtils.substring(filename,i+1,filename.length()); filename = StringUtils.substring(filename,i+1,filename.length());
return filename; return filename;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!