You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2008/09/03 19:48:24 UTC

DO NOT REPLY [Bug 45735] New: Updated ResourceAttributes.getETag

https://issues.apache.org/bugzilla/show_bug.cgi?id=45735

           Summary: Updated ResourceAttributes.getETag
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: remm@apache.org


After looking at a user's list post, I noticed the implementation was not
consistent with the other getters (like getName).

I propose changing it to:
    public String getETag(boolean strong) {
        if (strong) {
            // The strong ETag must always be calculated by the resources
            if (strongETag != null)
                return strongETag;
            if (attributes != null) {
                Attribute attribute = attributes.get(ETAG);
                if (attribute != null) {
                    try {
                        strongETag = attribute.get().toString();
                    } catch (NamingException e) {
                        ; // No value for the attribute
                    }
                }
            }
            return strongETag;
        } else {
            // The weakETag is contentLenght + lastModified
            if (weakETag == null) {
                weakETag = "W/\"" + getContentLength() + "-" 
                    + getLastModified() + "\"";
            }
            return weakETag;
        }
    }


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 45735] Updated ResourceAttributes.getETag

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45735


Chris Hubick <ch...@hubick.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris@hubick.com




--- Comment #1 from Chris Hubick <ch...@hubick.com>  2008-09-27 15:54:00 PST ---
I just saw this, after having filed bug 45906 with more extensive fixes.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 45735] Updated ResourceAttributes.getETag

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45735


Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #2 from Mark Thomas <ma...@apache.org>  2008-10-27 06:27:40 PST ---
This has been applied to 6.0.x and will be in 6.0.19 onwards.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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