The URL classes (why aren't you just opening the file directly with "new File(name)"?) might attempt to detect a filename when there's no protocol specified (the "file://"), and if so perhaps spaces make it think it's not a file.
If you
really need to know, open up the code in java.net.URL and friends and find out.