code: public static String normalizeName(String name) {
          String fileName = NAME_FORBIDDEN_PATTERN.matcher(name).replaceAll("_");
          fileName = fileName.replaceAll(String.format("([%1$s])([%1$s]+)", "-_"), "$1");
          fileName = StringUtils.strip(fileName, "_-");
          fileName = fileName.trim();
          return fileName;
      }
docs: Create a normalized name from an arbitrary string.<br>
  Paths separators are replaced, so this function can't be applied on a whole path, but must be called on each path sections.
  
  @param name current name of the file
  @return a normalized filename