/** * Determine the last modified date of this WebResource. * <p> * Note that the http client may read the entire file. * </p> * * @return the last mod date of the file */ public long getLastModified() { HttpRequestBase method = new HttpHead(uri); HttpResponse response = null; try { // Execute the method. response = client.execute(method); StatusLine statusLine = response.getStatusLine(); if (statusLine.getStatusCode() == HttpStatus.SC_OK) { return getHeaderAsDate(response, "Last-Modified"); } String reason = response.getStatusLine().getReasonPhrase(); // TRANSLATOR: Common error condition: {0} is a placeholder for the // URL of what could not be found. Reporter.informUser(this, JSMsg.gettext("Unable to find: {0}", reason + ':' + uri.getPath())); } catch (IOException e) { return new Date().getTime(); } return new Date().getTime(); }