From f2b83c2eb8eefba46e6784e6366f1b49bef6c2de Mon Sep 17 00:00:00 2001 From: funkman Date: Thu, 27 Dec 2007 01:57:02 +0000 Subject: [PATCH] http://issues.apache.org/bugzilla/show_bug.cgi?id=42503 ServletContext.getResourceAsStream returns stale data patch by Arvind Srinivasan arvindDOTsrinivasan sun com git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@606994 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/naming/resources/FileDirContext.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/org/apache/naming/resources/FileDirContext.java b/java/org/apache/naming/resources/FileDirContext.java index ddb40feb5..58e54e46d 100644 --- a/java/org/apache/naming/resources/FileDirContext.java +++ b/java/org/apache/naming/resources/FileDirContext.java @@ -986,6 +986,8 @@ public class FileDirContext extends BaseDirContext { public FileResourceAttributes(File file) { this.file = file; + getCreation(); + getLastModified(); } // --------------------------------------------------- Member Variables @@ -1036,7 +1038,7 @@ public class FileDirContext extends BaseDirContext { public long getCreation() { if (creation != -1L) return creation; - creation = file.lastModified(); + creation = getLastModified(); return creation; } @@ -1048,7 +1050,7 @@ public class FileDirContext extends BaseDirContext { */ public Date getCreationDate() { if (creation == -1L) { - creation = file.lastModified(); + creation = getCreation(); } return super.getCreationDate(); } @@ -1074,7 +1076,7 @@ public class FileDirContext extends BaseDirContext { */ public Date getLastModifiedDate() { if (lastModified == -1L) { - lastModified = file.lastModified(); + lastModified = getLastModified(); } return super.getLastModifiedDate(); } -- 2.11.0