tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1163716 - /tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java
Date Wed, 31 Aug 2011 17:45:45 GMT
Author: markt
Date: Wed Aug 31 17:45:45 2011
New Revision: 1163716

URL: http://svn.apache.org/viewvc?rev=1163716&view=rev
Log:
Revert r1163643

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java?rev=1163716&r1=1163715&r2=1163716&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspCompilationContext.java Wed Aug 31 17:45:45
2011
@@ -385,6 +385,49 @@ public class JspCompilationContext {
         return jspUri;
     }
 
+    /**
+     * @deprecated Will be removed in Tomcat 8.0.x. Use
+     * {@link #getLastModified(String)} instead.
+     */
+    @Deprecated
+    public long getJspLastModified() {
+        long result = -1;
+        URLConnection uc = null;
+        try {
+            URL jspUrl = getResource(getJspFile());
+            if (jspUrl == null) {
+                incrementRemoved();
+                return result;
+            }
+            uc = jspUrl.openConnection();
+            if (uc instanceof JarURLConnection) {
+                result = ((JarURLConnection) uc).getJarEntry().getTime();
+            } else {
+                result = uc.getLastModified();
+            }
+        } catch (IOException e) {
+            if (log.isDebugEnabled()) {
+                log.debug(Localizer.getMessage(
+                        "jsp.error.lastModified", getJspFile()), e);
+            }
+            result = -1;
+        } finally {
+            if (uc != null) {
+                try {
+                    uc.getInputStream().close();
+                } catch (IOException e) {
+                    if (log.isDebugEnabled()) {
+                        log.debug(Localizer.getMessage(
+                                "jsp.error.lastModified", getJspFile()), e);
+                    }
+                    result = -1;
+                }
+            }
+        }
+        return result;
+    }
+
+
     public Long getLastModified(String resource) {
         long result = -1;
         URLConnection uc = null;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message