question: private static String encodePath ( String path ) { StringBuilder buffer = new StringBuilder ( ) ; for ( int i = 0 ; i < path . length ( ) ; i ++ ) { char c = path . charAt ( i ) ; if ( c == ' ' ) { buffer . append ( "%20" ) ; } else { buffer . append ( c ) ; } } return buffer . toString ( ) ; }
target:  Encodes the given path for compatibility with URIs.