In Java, File
is just an abstraction to a file system path (file or directory); it does not contain the file contents.
In a client/server set up where you need to send a file over the network, you will need to use Java's IO constructs for that. Exactly how will depend on how you intend communication to be done (HTTP, Sockets, RMI).