Java tutorial
//package com.java2s; public class Main { public static boolean isInvalidPictureFile(String mimeType) { String lowerCaseFilepath = mimeType.toLowerCase(); return (lowerCaseFilepath.contains("jpg") || lowerCaseFilepath.contains("jpeg") || lowerCaseFilepath.toLowerCase().contains("png") || lowerCaseFilepath.toLowerCase().contains("bmp") || lowerCaseFilepath.toLowerCase().contains("gif")); } }