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 isPdfFileWithSuffixName(String suffixName) {
        if (isEmpty(suffixName)) {
            return false;
        }
        suffixName = suffixName.toLowerCase();
        if ("pdf".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;
    }
}