toURI method of File transform space character into %20
On windows XP with Java 6
public static void main(String[] args) {
File f = new File("C:\\My dir\\test.txt");
URI uri = f.toURI();
System.out.println(f.getAbsolutePath());
System.out.println(uri);
}
C:\My dir\test.txt file:/C:/My%20dir/test.txt