private static String join ( String prefix , String suffix ) { int prefixLength = prefix . length ( ) ; boolean haveSlash = ( prefixLength > 0 && prefix . charAt ( prefixLength - 1 ) == separatorChar ) ; if ( ! haveSlash ) { haveSlash = ( suffix . length ( ) > 0 && suffix . charAt ( 0 ) == separatorChar ) ; } return haveSlash ? ( prefix + suffix ) : ( prefix + separatorChar + suffix ) ; }
Joins two path components adding a separator only if necessary .