code: public static String getResourceName(String resource, boolean singularize) {
  		if (StringUtils.hasText(resource)) {
  			String resourceName = StringUtils.capitalize(resource);
  			if (singularize) {
  				resourceName = singularize(resourceName);
  			}
  			resourceName = StringUtils.capitalize(cleanNameForJava(resourceName));
  			return resourceName;
  		}
  
  		return null;
  	}
docs: Attempts to infer the name of a resource from a resources's relative URL
  
  @param resource
  The Url representation of this object
  @param singularize
  indicates if the resource name should be singularized or not
  @return A name representing this resource or null if one cannot be
  inferred