String[] schemes = {"http","https"};
UrlValidator urlValidator = new UrlValidator(schemes, UrlValidator.ALLOW_ALL_SCHEMES);
System.out.println(urlValidator.isValid(myUrl));
the following URL says, invalid. Any one know why is that. the localnet is a localnetwork. But this works for any other public network (it seems).
http://aunt.localnet/songs/barnbeat.ogg
The class you're using is deprecated. The replacement is
org.apache.commons.validator.routines.UrlValidator
Which is more flexible. You can pass the flag ALLOW_LOCAL_URLS to the constructor which would allow most addresses like the one you are using. In our case, we had authentication data preceeding the address, so we had to use the even-more-flexible UrlValidator(RegexValidator authorityValidator, long options) constructor.