ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: update
Date Thu, 08 Jun 2000 11:49:20 GMT
>>>>> "TH" == Thomas Haas <> writes:

 >>  You could simply call translatePath for single >> filenames as
 >>  well, couldn't you?

 TH> translatePath returns a list of Strings, whereas translateFile
 TH> returns a single String and does not mess with path separators.

So just use the first one? Maybe

    public static String translateFile(String source) {
        if (source == null || source.length() == 0) return "";
        return (String) translatePath(source).elementAt(0);

instead of duplicating the / \ replacement. "Once And Only Once" to
cite an XP mantra - that I wouldn't follow religously of course.

Either source doesn't include a PathSeparator or it's a : on DOS based
systems (forgot OS/2 in my list) or we are in trouble anyway.


View raw message