code: private String getPathSegment(String pattern) {
  		int slash = pattern.indexOf('/', 1);
  		int dot = pattern.indexOf('.', 1);
  		String path;
  
  		if (slash > 0) {
  			path = pattern.substring(0, slash);
  		} else if (dot > 0) {
  			path = pattern.substring(0, dot);
  		} else {
  			path = pattern;
  		}
  
  		return path;
  	}
docs: Returns the first part of the URL path. Either the leading slash to the first
  period ('.') or the first slash to the second slash.
  
  @param pattern a URL pattern.
  @return