Java tutorial
//package com.java2s; public class Main { public static boolean isOfficeAllowRead(String suffix) { String[] suffixs = { ".doc", ".docx", ".xls", ".xlsx", ".pptx", ".ppt", ".txt", ".pdf" }; for (String s : suffixs) { if (s.equalsIgnoreCase(suffix)) { return true; } } return false; } }