How can I check if a string is a URL in Java?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
This function validates a URL, and returns true (valid URL) or false (invalid URL).
Be sure to
import java.net.URL;
You can try to create a
java.net.URL
object out of it. If it is not a proper URL, aMalformedURLException
will be thrown.