Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**
     * Check if file is an image based on it's extension.
     *
     * @see <a href="http://developer.android.com/guide/appendix/media-formats.html">Supported Media Formats</a>
     */
    public static boolean isImage(String filename) {
        if (filename == null)
            return false;

        if (filename.toLowerCase().endsWith(".png") || filename.toLowerCase().endsWith(".jpg")
                || filename.toLowerCase().endsWith(".bmp") || filename.toLowerCase().endsWith(".gif")) {
            return true;
        }
        return false;
    }
}