简体   繁体   中英

How can I check if a URI displayed by java.awt.Desktop is blank or not

I want to write a program that opens different URI's while changing a parameter. How can I check if the loaded page is blank or has data?

Not possible, since Desktop.browse(...) opens the systems default browser, which will be an external program. But you can use the URL class to open a connection to your URLs, and check if the underlying inputstream contains data (InputStream.available()).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM