Returns true if the specified file extension can be written
import java.io.File; import java.util.Iterator; import javax.imageio.ImageIO; public class Main { public static void main(String[] argv) throws Exception { boolean b; b = canWriteExtension("yourExtensionName"); b = canWriteExtension("gif"); b = canWriteExtension("giF"); } public static boolean canWriteExtension(String fileExt) { Iterator iter = ImageIO.getImageWritersBySuffix(fileExt); return iter.hasNext(); } }