List<String> (@NotNull String fileName) { List<String> patterns = new LinkedList<>(); int i = -1; while ((i = fileName.indexOf('.', i + 1)) > 0) { String extension = fileName.substring(i); if (!StringUtil.isEmpty(extension)) { patterns.add(0, "*" + extension); } } if (FileTypeManager.getInstance().getFileTypeByFileName(fileName) == FileTypes.UNKNOWN) { patterns.add(fileName); } else { patterns.add(0, fileName); } return patterns; }