@RequestMapping(value ="/htmlFiveVideo/addVideo",produces="application/text;charset=UTF-8")
public String videoAdd(HtmlFiveVideo video,@RequestParam(value="file",required=false) MultipartFile file,HttpServletRequest request){
String fileName = file.getOriginalFilename();
File targetFile = new File(FILE_URL+fileName);
try {
if(!targetFile.exists()){
file.transferTo(targetFile);
}
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
video.setVideoUrl(FILE_SHOW_URL+fileName);
videoService.addVideo(video);
return "/admin/htmlFiveVideo/videoList";
}
public String videoAdd(HtmlFiveVideo video,@RequestParam(value="file",required=false) MultipartFile file,HttpServletRequest request){
String fileName = file.getOriginalFilename();
File targetFile = new File(FILE_URL+fileName);
try {
if(!targetFile.exists()){
file.transferTo(targetFile);
}
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
video.setVideoUrl(FILE_SHOW_URL+fileName);
videoService.addVideo(video);
return "/admin/htmlFiveVideo/videoList";
}