You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2005/12/30 16:29:42 UTC

DO NOT REPLY [Bug 37548] - Jar manifest lines too long

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=37548>.
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=37548





------- Additional Comments From arjan.kok@nl.compuware.com  2005-12-30 16:29 -------
I propose to use the jkd make72safe to write the manifest:

       /**
         * Adds line breaks to enforce a maximum 72 bytes per line.
         */
        static void make72Safe(StringBuffer line) {
            int length = line.length();
            if (length > 72) {
                int index = 70;
                while (index < length - 2) {
                    line.insert(index, "\r\n ");
                    index += 72;
                    length += 3;
                }
            }
            return;
        }

It could be used as follows:

        /**
         * Write a single attribute value out
         *
         * @param writer the Writer to which the attribute is written
         * @param value the attribute value
         *
         * @throws IOException if the attribute value cannot be written
         */
        private void writeValue(PrintWriter writer, String value) throws 
IOException {
            String line = name + ": " + value +EOL;
            StringBuffer buf = new StringBuffer(line);
            make72Safe(buf);
            writer.print(buf.toString());
         }

This also solves bug 34425.

Regards, Arjan Kok.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

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