gamliela
gamliela

Reputation: 4069

Replacement for java.net.URL

I'm looking for replacement for java.net.URL.

My only interest is in modeling and syntax validation. Nice features are abilities to extract only parts of the URL, removal of fragment sign etc.

I'm not interested in network capabilities of any kind, and the class shouldn't do any network operation.

Another requirement is minimum dependencies.

The problem with current java.net.URL is that it can't model protocols other than [http, https, ftp, file, and jar].

Thanks!

Upvotes: 2

Views: 2550

Answers (4)

Suresh Kumar
Suresh Kumar

Reputation: 11767

If you just want to validate a URL, you should probably look at URLValidator from Apache Commons Validator project. The validator supports different schemes as well.

Upvotes: 1

JB Nizet
JB Nizet

Reputation: 691735

Isn't java.net.URI what you're looking for?

Upvotes: 2

Bozho
Bozho

Reputation: 597106

java.net.URI

Upvotes: 3

Mairbek Khadikov
Mairbek Khadikov

Reputation: 8089

Take a look at java.net.URI which can be used as a replacement of evil java.net.URL.

Upvotes: 10

Related Questions