728x90
반응형
@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
@RequestMapping(value = "/getImgExtArray", method = { RequestMethod.GET, RequestMethod.POST })
public ModelAndView getImgExtArray(@RequestParam(value = "ext", defaultValue = "") String ext) {
ext = ext.toUpperCase();
String imgExtStr = "JPEG,BMP,RLE,JPG,GIF,PNG,PSD,PDD,TIF,PDF,RAW,AI,EPS,IFF,FPX,FRM,PCX,PCT,PIC,PXR,SCT,TGA,VDA,ICB,VST";
String[] imgExtArray = imgExtStr.split(",");
int flag = -1;
for (int i = 0; i < imgExtArray.length; i++) {
if (ext.equals(imgExtArray[i])) {
flag = 1;
break;
} else if (ext.equals("")) {
flag = 1;
} else {
flag = -1;
}
}
ModelAndView mav = new ModelAndView();
mav.addObject("flag", flag);
return mav;
}
|
cs |
@
728x90
반응형