Why does Java not have a file copy method? This seems like such an obvious thing to have, and it saves people from writing things like this example.
My guess is because when the File io system was written, they decided they did not want to deal with the cross-platform problems of copying files, and punted - i.e. they said "this is doable by others, and is not that common".
One thing to keep in mind about Java is that it is cross-platform, so some things are more difficult because of that reality.
The Java API is missing more than just file copying. You might be interested in checking out the Apache Commons libraries. For example, the IO library's FileUtils provides file copying methods.
java.io.File
is a relatively simple class introduced in 1.0. JDK 1.0 didn't have much in it - mostly related to support for applets and the javac compiler. I guess there hasn't been a great deal of pressure to expand it - applets and enterprise software are not oriented in that direction.
However, lots has been added to I/O for JDK7. Including [java.nio.file.Path.copyTo
][1].
[1]: http://download.java.net/jdk7/docs/api/java/nio/file/Path.html#copyTo%28java.nio.file.Path, java.nio.file.CopyOption...)