Typical roseindia - hardly an expert solution, and more important to this thread, does nothing about the file headers.
riahc3 - have you had a look at the NIO (new I/O) classes in Java 7? They have lots of new stuff for copying files and handing file attributes - even OS-dependent headers. http://docs.oracle.com/javase/tutorial/essential/io/fileio.html
See especially Files.copy(source, target, COPY_ATTRIBUTES);