public static String normalizeDriveLetter ( String file ) { if ( file . length ( ) > 2 && file . charAt ( 1 ) == ' ' ) { return Character . toUpperCase ( file . charAt ( 0 ) ) + file . substring ( 1 ) ; } else if ( file . length ( ) > 3 && file . charAt ( 0 ) == ' ' && file . charAt ( 2 ) == ' ' ) { // Handle a wildcard * at the beginning of the string. return file . substring ( 0 , 1 ) + Character . toUpperCase ( file . charAt ( 1 ) ) + file . substring ( 2 ) ; } return file ; }
Normalize windows drive letter paths to upper case to enable string comparison .