DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30329>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30329

Speed up and reduce response size for DirectoryIndexGenerator

           Summary: Speed up and reduce response size for
                    DirectoryIndexGenerator
           Product: Slide
           Version: 2.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: WebDAV Server
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Change the implementation so that not every character is converted to &#xNNNN; 
form.  The response writer will take care of non latin characters as it is 
created with UTF-8.  Latin will be 1 byte instead of 6, and non latin will be 
3 instead of 8. 
OLD============================================================================
    private String stringToCharacterRef(String val) {
        StringBuffer result = new StringBuffer(val.length() * 8);
        for (int i = 0; i < val.length(); i++) {
            result.append(charToCharacterRef(val.charAt(i)));
        }
        return result.toString();
    }
NEW============================================================================
<remove charToCharacterRef method>

<probably should rename this to something like escapeHTML>

    private String stringToCharacterRef(String val) {
        StringBuffer result = new StringBuffer(val.length());
        char ch;
        for (int i = 0; i < val.length(); i++) {
            ch = val.charAt(i);
            switch (ch)
            {
                case '<':
                    result.append("&lt;");
                    break;

                case '>':
                    result.append("&gt;");
                    break;

                case '&':
                    result.append("&amp;");
                    break;

                default:
                    result.append(ch);
                    break;
            }
        }
/*
        StringBuffer result = new StringBuffer(val.length() * 8);
        for (int i = 0; i < val.length(); i++) {
            result.append(charToCharacterRef(val.charAt(i)));
        }
*/
        return result.toString();
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to