code: protected static boolean isValidOrigin(String origin) {
  		//Changed by Shark to support origin file:// & null
  		if ("file://".equals(origin) || "null".equals(origin)) {
  			return true;
  		}
  
  		// Checks for encoded characters. Helps prevent CRLF injection.
  		if (origin.contains("%")) {
  			return false;
  		}
  
  		URI originURI;
  
  		try {
  			originURI = new URI(origin);
  		} catch (URISyntaxException e) {
  			return false;
  		}
  		// If scheme for URI is null, return false. Return true otherwise.
  		return originURI.getScheme() != null;
  
  	}
docs: Checks if a given origin is valid or not. Criteria:
  <ul>
  <li>If an encoded character is present in origin, it's not valid.</li>
  <li>Origin should be a valid {@link URI}</li>
  </ul>
  
  @param origin
  @see <a href="http://tools.ietf.org/html/rfc952">RFC952</a>