class CssUtils {

	public String extractUrl(final String url) {
		String str = null;
		if (url.startsWith("url")) {
			String urlString = url.substring(3).trim().replace("(", "").replace(")", "").trim();
			if (urlString.startsWith("'") && urlString.endsWith("'")) {
				str = urlString.substring(urlString.indexOf("'")+1, urlString.lastIndexOf("'"));
			} else if ( urlString.startsWith("\"") && urlString.endsWith("\"") ) {
				str = urlString.substring(urlString.indexOf('"')+1, urlString.lastIndexOf('"'));
			} else {
			    str = urlString;
			}
		} else {
			// assume it's an url without wrapping in "url()"
			str = url;
		}
		return str;
	}

	private  CssUtils();

}