String (String pattern) { pattern = pattern.trim(); if (pattern.startsWith(SelectorUtils.REGEX_HANDLER_PREFIX)) { if (File.separatorChar == '\\') { pattern = StringUtils.replace(pattern, "/", "\\\\"); } else { pattern = StringUtils.replace(pattern, "\\\\", "/"); } } else { pattern = pattern.replace(File.separatorChar == '/' ? '\\' : '/', File.separatorChar); if (pattern.endsWith(File.separator)) { pattern += "**"; } } return pattern; }