private static void appendPathElt ( final Object pathElt , final StringBuilder buf ) { if ( buf . length ( ) > 0 ) { buf . append ( File . pathSeparatorChar ) ; } // Escape any rogue path separators, as long as file separator is not '\\' (on Windows, if there are any // extra ';' characters in a path element, there's really nothing we can do to escape them, since they can't // be escaped as "\\;") final String path = File . separatorChar == ' ' ? pathElt . toString ( ) : pathElt . toString ( ) . replaceAll ( File . pathSeparator , "\\" + File . pathSeparator ) ; buf . append ( path ) ; }
Append a path element to a buffer .