protected HttpMethodBase createMethod ( String url , HTTPMethod httpMethod ) { if ( httpMethod == null ) { throw new FaxException ( "HTTP method not provided." ) ; } if ( ( url == null ) || ( url . length ( ) == 0 ) ) { throw new FaxException ( "HTTP URL not provided." ) ; } //create method HttpMethodBase httpMethodClient = null ; switch ( httpMethod ) { case POST : httpMethodClient = new PostMethod ( url ) ; break ; case GET : httpMethodClient = new GetMethod ( url ) ; break ; case PUT : httpMethodClient = new PutMethod ( url ) ; break ; } return httpMethodClient ; }
This function creates and returns a new HTTP method .