public static boolean checkCharacter(int c, boolean foundQuestionMark) throws IOException {
		if(foundQuestionMark) {
			switch(c) {
				case '.':
				case '-':
				case '*':
				case '_':
				case '+': // converted space
				case '%': // encoded value
				// Other characters used outside the URL data
				//case ':':
				//case '/':
				//case '@':
				//case ';':
				//case '?':
				// Parameter separators
				case '=':
				case '&':
				// Anchor separator
				case '#':
					return true;
				default:
					if(
						(c<'a' || c>'z')
						&& (c<'A' || c>'Z')
						&& (c<'0' || c>'9')
					) throw new IOException(ApplicationResources.accessor.getMessage("UrlValidator.invalidCharacter", Integer.toHexString(c)));
					return true;
			}
		} else {
			return c=='?';
		}
	}
public static boolean checkCharacter ( int c , boolean foundQuestionMark ) throws IOException { if ( foundQuestionMark ) { switch ( c ) { case '.' : case '-' : case '*' : case '_' : case '+' : case '%' : case '=' : case '&' : case '#' : return true ; default : if ( ( c < 'a' || c > 'z' ) && ( c < 'A' || c > 'Z' ) && ( c < '0' || c > '9' ) ) throw new IOException ( ApplicationResources . accessor . getMessage ( "UrlValidator.invalidCharacter" , Integer . toHexString ( c ) ) ) ; return true ; } } else { return c == '?' ; } }
Checks one character, throws IOException if invalid.
@see java.net.URLEncoder
@return <code>true</code> if found the first '?'.