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();
}

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 ( ) ; }
encodes the given path for compatibility with uris .
