ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21042] - Setting XSL parameter to input filename when processed whole directory.
Date Fri, 28 Jul 2006 19:29:44 GMT
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=21042>.
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=21042





------- Additional Comments From apache-bugzilla@vitoni.de  2006-07-28 19:29 -------
Jan, have you looked at my patch?

The following:
--------------------------------------------------------------------------------
        if (fileDirParameter != null) {
            String fileName = FileUtils.getRelativePath(baseDir, inFile);

            int lastDirSep = fileName.lastIndexOf("/");

            // so a dir+"/"+name would not result in an absolute path
            String dir  = (-1 == lastDirSep ) ? "." : fileName.substring(0,
lastDirSep);

            liaison.addParam(fileDirParameter, dir);
        }
--------------------------------------------------------------------------------
seems cheaper CPU-cycle wise than involving filesystem actions as in:
--------------------------------------------------------------------------------
        if (fileDirParameter != null) {
            String fileName = FileUtils.getRelativePath(baseDir, inFile);
            File file = new File(fileName);
            // Give always a slash as file separator, so the stylesheet could be
sure about that
            // Use '.' so a dir+"/"+name would not result in an absolute path
            liaison.addParam(fileDirParameter, (file.getParent()!=null) ?
file.getParent().replace('\\','/') : "." );
        }
--------------------------------------------------------------------------------


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

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


Mime
View raw message