I am looking for a Java Library to validate a URL and to strip out certain parameters. The order of the parameters does not matter.
I was using regex but it is very slow. This method is called alot of times and needs to be fast.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Apache Commons Validator includes
UrlValidatorclass incommons-validator-1.3.1.jar. Following method is used to validate a given media resource locator (MRL) in VLCJ which is basically a URL. However,UrlValidatordoesn’t work for file-based URL (withfile://scheme)Sorry that this function doesn’t do any stripping of parameters (or I would say “schemes”). But, it can be done easily with
replace()orsubstring()