자바(Java)
자바 파일명에 금지 확장자 배열에 값이 있는지 체크
xemaker
2018. 1. 10. 13:29
자바 파일명에 금지 확장자체크 하는 방법과 배열에 값이 있는지 체크하는 방법 입니다.
public static boolean isDenyExt (String fileName){
int pos=0;
boolean isContain=false;
String [] arrExt={"jsp","php"};
pos = fileName.lastIndexOf (".");
String ext = fileName.subString (pos+1);
isContain = Array.asList (arrExt).contains (ext);
return isContain;
}
배열에 값이 있는지 체크 하는 방법 입니다.
Array.asList (arrExt).contains (ext);
public static boolean isDenyExt (String fileName){
int pos=0;
boolean isContain=false;
String [] arrExt={"jsp","php"};
pos = fileName.lastIndexOf (".");
String ext = fileName.subString (pos+1);
isContain = Array.asList (arrExt).contains (ext);
return isContain;
}
배열에 값이 있는지 체크 하는 방법 입니다.
Array.asList (arrExt).contains (ext);