1 22 23 package org.cofax.cms; 24 25 import java.io.*; 26 import java.net.*; 27 28 38 39 public class CofaxToolsClearCache extends Thread { 40 41 String URLToGet; 42 43 51 CofaxToolsClearCache(String URLToGet) { 52 this.URLToGet = URLToGet; 53 } 54 55 public void run() { 56 URL url = null; 57 HttpURLConnection connection = null; 58 int responseCode = 0; 59 try { 60 CofaxToolsUtil.log("CofaxToolsClearCache run clearing Cache: " + URLToGet); 61 url = new URL(URLToGet); 62 connection = (HttpURLConnection) url.openConnection(); 63 responseCode = connection.getResponseCode(); 64 } catch (MalformedURLException ex) { 65 CofaxToolsUtil.log("CofaxToolsClearCache run ERROR: Malformed URL: " + URLToGet); 66 } catch (IOException ex) { 67 CofaxToolsUtil.log("CofaxToolsClearCache run ERROR: IO Exception: " + URLToGet); 68 } 69 if (responseCode != 200) { 70 CofaxToolsUtil.log("CofaxToolsClearCache run ERROR: " + responseCode + " " + URLToGet); 71 } 72 } 73 74 } 75 | Popular Tags |