Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static boolean isZIPFileWithSuffixName(String suffixName) { if (isEmpty(suffixName)) { return false; } suffixName = suffixName.toLowerCase(); if ("zip".equals(suffixName) || "rar".equals(suffixName) || "7z".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; } }