Java tutorial
//package com.java2s; public class Main { private static boolean isImageFormat(String fileName) { if (fileName == null) { return false; } fileName = fileName.toLowerCase(); if (fileName.endsWith(".jpg") || fileName.endsWith(".jpeg") || fileName.endsWith(".png") || fileName.endsWith(".bmp") || fileName.endsWith(".jpe") || fileName.endsWith(".gif") || fileName.endsWith(".wbmp")) { return true; } return false; } }