agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/util/Slug.java
/**
	 * Turn a string into a slug. Custom replacemetns are honored before creating the slug,
	 * thus any non-alphanumeric values will be either dropped or converted to dashes.
	 * 
	 * @param input String to slugify
	 * @return valid slug
	 */
Turn a string into a slug. Custom replacemetns are honored before creating the slug,
thus any non-alphanumeric values will be either dropped or converted to dashes.

@param input String to slugify
@return valid slug
Turn a string into a slug . Custom replacemetns are honored before creating the slug thus any non - alphanumeric values will be either dropped or converted to dashes . @param input String to slugify @return valid slug
public String slugify(String input) {
		if (input == null) {
			return "";
		}
		input = input.trim();
		Map<String, String> customReplacements = getCustomReplacements();
		if (customReplacements != null) {
			for (Entry<String, String> entry : customReplacements.entrySet()) {
				input = input.replace(entry.getKey(), entry.getValue());
			}
		}
		for (Entry<Object, Object> e : replacements.entrySet()) {
			input = input.replace((String) e.getKey(), (String) e.getValue());
		}
		input = Normalizer.normalize(input, Normalizer.Form.NFD)
				.replaceAll("'", "")
				.replaceAll("[^\\p{ASCII}]", "")
				.replaceAll("[^\\w+]", "-")
				.replaceAll("\\s+", "-")
				.replaceAll("[-]+", "-")
				.replaceAll("^-", "")
				.replaceAll("-$", "");
		if (getLowerCase()) {
			input = input.toLowerCase();
		}
		return input;
	}
public String slugify ( String input ) { if ( input == null ) { return "" ; } input = input . trim ( ) ; Map < String , String > customReplacements = getCustomReplacements ( ) ; if ( customReplacements != null ) { for ( Entry < String , String > entry : customReplacements . entrySet ( ) ) { input = input . replace ( entry . getKey ( ) , entry . getValue ( ) ) ; } } for ( Entry < Object , Object > e : replacements . entrySet ( ) ) { input = input . replace ( ( String ) e . getKey ( ) , ( String ) e . getValue ( ) ) ; } input = Normalizer . normalize ( input , Normalizer . Form . NFD ) . replaceAll ( "'" , "" ) . replaceAll ( "[^\\p{ASCII}]" , "" ) . replaceAll ( "[^\\w+]" , "-" ) . replaceAll ( "\\s+" , "-" ) . replaceAll ( "[-]+" , "-" ) . replaceAll ( "^-" , "" ) . replaceAll ( "-$" , "" ) ; if ( getLowerCase ( ) ) { input = input . toLowerCase ( ) ; } return input ; }
Turn a string into a slug.
Turn a string into a slug .