Java tutorial
//package com.java2s; //License from project: Apache License public class Main { private static String IMAGE_TYPT_GIF = "gif"; /** * judge a image format is gif or not * * @param imageName * image'name * @return true is gif format, false isn't gif format */ public static boolean isGifFormatImage(String imageName) { String string = imageName.substring(imageName.lastIndexOf(".") + 1); if (string.equalsIgnoreCase(IMAGE_TYPT_GIF)) { return true; } else { return false; } } }