code: public static String escapeName(String name) {
          if (StringUtils.isBlank(name)) {
              throw new IllegalArgumentException("Blank or null is not a valid name.");
          } else if (java.util.regex.Pattern.matches(NAME, name)) {
              return name;
          } else {
              return name.replaceAll("[^A-Za-z0-9\\.\\-_]", "-");
          }
      }
docs: Makes sure the given <code>name</code> is escaped properly before being used as a valid name.
  
  @param name Name to convert
  @return Name which is safe to use
  @see #NAME