if (extension.indexOf('.") != -1) { extension = extension.substring(extension.lastIndexOf('.")+1); } extensions.add(extension);
String extension = filename.substring(filename.lastIndexOf('.")+1); if (extensions.contains(extension)) { return true; } return false;