Is there a class that has defined constants for common port numbers like 80, 443, 21?
The only way right now I found is using getDefaultPort
on URL that has a http
, https
or ftp
schema, but it looks excessive to just get a constant.
I'm asking because I don't want to throw a bunch of magic numbers around the code and I assume there should be a place with those constants somewhere (e.g. we have one for UTF8 now).