agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/util/Slug.java
/**
	 * Static accessor to create a slug explicitly specifiying case behavior.
	 * 
	 * @param input String to slugify
	 * @param lowerCase if true, returned value will be lowercase. Original case otherwise.
	 * @return
	 */
Static accessor to create a slug explicitly specifiying case behavior.

@param input String to slugify
@param lowerCase if true, returned value will be lowercase. Original case otherwise.
@return
Static accessor to create a slug explicitly specifiying case behavior . @param input String to slugify @param lowerCase if true returned value will be lowercase . Original case otherwise . @return
public static String toSlug(String input, boolean lowerCase) 
	{
		try
		{
			return new Slug(lowerCase).slugify(input);
		}
		catch (IOException e)
		{
			input = Normalizer.normalize(input, Normalizer.Form.NFD)
					.replaceAll("[^\\p{ASCII}]", "")
					.replaceAll("[^\\w+]", "-")
					.replaceAll("\\s+", "-")
					.replaceAll("[-]+", "-")
					.replaceAll("^-", "")
					.replaceAll("-$", "");
			if (lowerCase) {
				input = input.toLowerCase();
			}
			return input;
		}
	}
public static String toSlug ( String input , boolean lowerCase ) { try { return new Slug ( lowerCase ) . slugify ( input ) ; } catch ( IOException e ) { input = Normalizer . normalize ( input , Normalizer . Form . NFD ) . replaceAll ( "[^\\p{ASCII}]" , "" ) . replaceAll ( "[^\\w+]" , "-" ) . replaceAll ( "\\s+" , "-" ) . replaceAll ( "[-]+" , "-" ) . replaceAll ( "^-" , "" ) . replaceAll ( "-$" , "" ) ; if ( lowerCase ) { input = input . toLowerCase ( ) ; } return input ; } }
Static accessor to create a slug explicitly specifiying case behavior.
Static accessor to create a slug explicitly specifiying case behavior .