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, 11 Aug 2006 19:32:35 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


apache-bugzilla@vitoni.de changed:

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




------- Additional Comments From apache-bugzilla@vitoni.de  2006-08-11 19:32 -------
(In reply to comment #31)
> 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('\\','/') : "." );
>         }
> --------------------------------------------------------------------------------
> 

Jan, could you please comment why you used the file approach instead of the
String operation? Thanks.

-- 
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