How to read a specific file using a client side socket connection

157 views Asked by At

Having done a bit of searching/researching and not finding an answer, I turn to you all.

I want to read a specific file that resides in a specific directory using a socket from the client side. I am able to establish the connection with no problem but am unsure as to how to set-up a read for a specific file.

for example... filea.txt resides in directory called directoryA on serverX. How can fileA be read from serverY using a socket? Do I create a wrapper for socket.getInputStream to read that specific file? Is there a way to direct the connection to that specific directory?

Looking at the javadoc for the socket class, I do not see how to accomplish what I want to do with that.

Any information you can provide to lead me in the right direction is appreciated.

Thanks.

0

There are 0 answers