修正文件名

@param name 文件名
@return 修正后的文件名
184624
private String fixNameForProfile(String name) {
		Assert.notBlank(name, "Setting name must be not blank !");
		final String actralProfile = StrUtil.nullToEmpty(this.profile);
		if (false == name.contains(StrUtil.DOT)) {
			return StrUtil.format("{}/{}.setting", actralProfile, name);
		}
		return StrUtil.format("{}/{}", actralProfile, name);
	}
1251568
public static String stripGetterPrefix(String name) {
        if (StringUtils.isBlank(name)) {
            return name; // This should never happen.
        }
        String[] mName = StringUtils.splitByCharacterTypeCamelCase(name);
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < mName.length; i++) {
            sb.append(mName[i]);
        }
        return StringUtils.uncapitalize(sb.toString());
    }
783965
public static String classNameToSignature(String name) {
        int nameLength = name.length();
        int colonPos = 1 + nameLength;
        char[] buf = new char[colonPos + 1];
        buf[0] = 'L';
        buf[colonPos] = ';';
        name.getChars(0, nameLength, buf, 1);
        for (int i = 1; i != colonPos; ++i) {
            if (buf[i] == '.') {
                buf[i] = '/';
            }
        }
        return new String(buf, 0, colonPos + 1);
    }
289635
private static String sanitizeName(String name) {
		final String lowerCaseName = name.toLowerCase(Locale.US);
		final String separatorReplacedName = SANITIZE_TO_UNDERSCORE_PATTERN.matcher(lowerCaseName)
				.replaceAll(UNDERSCORE);
		return SANITIZE_REMOVE_PATTERN.matcher(separatorReplacedName).replaceAll(EMPTY_STRING);
	}
572309
public static String getCamelName(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        name = name.toLowerCase();
        //去掉前面的_
        while (name.startsWith("_")) {
            name = name.substring(1);
        }
        //去掉后面的_
        while (name.endsWith("_")) {
            name = name.substring(0, name.length() - 1);
        }

        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < name.length(); i++) {

            char c = name.charAt(i);

            if (c == '_') {
                i++;
                sb.append(Character.toUpperCase(name.charAt(i)));
                continue;
            }
            sb.append(c);
        }

        return sb.toString();
    }
724320
public String[] getFilenames(String name) 
    {
        List parts = (List)_partMap.getValues(name);
        if (parts==null)
            return null;
        String[] filenames = new String[parts.size()];
        for (int i=0; i<filenames.length; i++) {
            filenames[i] = ((Part)parts.get(i))._filename;
        }
        return filenames;
    }
1234237
public String getFilename(String name)
    {
        List part = (List)_partMap.getValues(name);
        if (part==null)
            return null;
        return ((Part)part.get(0))._filename;
    }
585859
private static String latexName(final String name) {
    final Matcher matcher = pattern.matcher(name);
    if (!matcher.matches())
      return name;
    if (matcher.group(2).isEmpty())
      return matcher.group(1);
    return matcher.group(1) + "_{" + matcher.group(2) + "}";
  }
1249082
public static String getUnderlineName(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < name.length(); i++) {
            char c = name.charAt(i);
            if (i > 0 && Character.isUpperCase(c)) {
                sb.append("_");
            }
            sb.append(c);
        }
        return sb.toString().toLowerCase();
    }
1298525
public static String extractGivenName(String name)
    {
        if (name.length() <= 2)
            return "_" + name.substring(name.length() - 1);
        else
            return name.substring(name.length() - 2);

    }
13633
private static boolean isClassOrConstantName(String name) {
    return name != null && name.length() > 1 && Character.isUpperCase(name.charAt(0));
  }
935924
public static boolean isValidFileName(@Nullable String name) {
        return !TextUtils.isEmpty(name)
                && !name.contains("/")
                && !name.equals(".")
                && !name.equals("..");
    }
743925
private String prepareName(String name) {
        // \s = A whitespace character: [ \t\n\x0B\f\r]
        String[] arr = name.split("\\s");
        List<String> list = new ArrayList<>(arr.length);
        for (int i = 0; i < arr.length; i++) {
            String rewrite = NON_WORD_CHAR.matcher(toLowerCase(arr[i])).replaceAll("");
            String tmp = rewriteMap.get(rewrite);
            if (tmp != null)
                rewrite = tmp;
            // Ignore matching short frases like de, la, ...
            if (!rewrite.isEmpty() && rewrite.length() > 2) {
                list.add(rewrite);
            }
        }
        return listToString(list);
    }
56507
public static CorpusFormat forName(@NonNull String name) {
      String format = StringUtils.trim(name).toUpperCase();
      boolean isOPL = format.endsWith("_OPL");
      final String normFormat = format.replaceAll("_OPL$", "").trim();
      if (formats.containsKey(normFormat)) {
         return isOPL ? new OnePerLineFormat(formats.get(normFormat)) : formats.get(normFormat);
      }
      throw new IllegalArgumentException(name + " is an unknown format.");
   }
146530
private static String utf8Name(final String name) {
    final Matcher matcher = pattern.matcher(name);
    if (!matcher.matches())
      return name;
    if (matcher.group(2).isEmpty())
      return matcher.group(1);
    return matcher.group(1) + getSubscript(matcher.group(2));
  }
8854
function makeFilenameRegex(name) {
  if (!_.isString(name)) {
    throw new TypeError('name parameter must be of type "String"');
  }

  const regexString = `^${name}(?:[.](.+))?.(${fileExtensions.join('|')})$`;
  return new RegExp(regexString);
}
650472
protected static boolean isValidFilename(String filename) {
		if (filename == null || filename.length() == 0) {
			throw new NullPointerException("文件名不能为空.");
		}
		if (filename.indexOf("..") != -1) {
			throw new IllegalArgumentException("文件名称不能包含'..'");
		}
		Matcher m = FILENAME_PATTERN.matcher(filename);
		return m.matches();
	}