Class NetUtil
java.lang.Object
fc.util.NetUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddownloadAndSaveImage(File output, String url) Downloads and saves data from url to specified file.static voidstatic booleanresourceExists(String url) Returns true if the specified resource exists, false otherwise.
-
Constructor Details
-
NetUtil
public NetUtil()
-
-
Method Details
-
downloadAndSaveImage
Downloads and saves data from url to specified file. The file should be a complete file (including directory information) and the name of the file can of course be arbitrary. (construct a file with the same name as the url if you need to save the url as-is, with the same name).- Throws:
IOException
-
resourceExists
Returns true if the specified resource exists, false otherwise. Uses HTTP HEAD method and a return code != 404 -
main
-