Class NetUtil

java.lang.Object
fc.util.NetUtil

public final class NetUtil extends Object
Network related utils (including HTTP) (the servlet/WebUtil class is for servlet specific utils)
  • Constructor Details

  • Method Details

    • downloadAndSaveImage

      public static void downloadAndSaveImage(File output, String url) throws IOException
      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

      public static boolean resourceExists(String url)
      Returns true if the specified resource exists, false otherwise. Uses HTTP HEAD method and a return code != 404
    • main

      public static void main(String[] args)