Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static boolean isAudioWithSuffixName(String suffixName) {
        if (isEmpty(suffixName)) {
            return false;
        }
        suffixName = suffixName.toLowerCase();
        if ("audio".equals(suffixName) || "mp3".equals(suffixName) || "wma".equals(suffixName)
                || "wav".equals(suffixName) || "ogg".equals(suffixName) || "m4a".equals(suffixName)
                || "mid".equals(suffixName) || "xmf".equals(suffixName) || "amr".equals(suffixName)
                || "aac".equals(suffixName)) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(String input) {
        if (input == null || "".equals(input) || "null".equals(input.toLowerCase()))
            return true;

        for (int i = 0; i < input.length(); i++) {
            char c = input.charAt(i);
            if (c != ' ' && c != '\t' && c != '\r' && c != '\n') {
                return false;
            }
        }
        return true;
    }
}