I got a strange behavior of that method:
import java.net.URI
URI url = new URI("https://pmi_artifacts_prod.s3.amazonaws.com");
System.out.println(url.getHost()); /returns NULL
URI url2 = new URI("https://s3.amazonaws.com");
System.out.println(url2.getHost()); //returns s3.amazonaws.com
`
i want first url.getHost()
to be pmi_artifacts_prod.s3.amazonaws.com, but it gives me NULL. Turned out that problem is with underscores in domain name, its a known bug, but still what can be done as I need to work with this host exactly?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…