my dog learned polymorphism*
The moose likes Sockets and Internet Protocols and the fly likes Sending Folder over socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Sending Folder over socket" Watch "Sending Folder over socket" New topic
Author

Sending Folder over socket

krish rajini
Greenhorn

Joined: Jul 02, 2008
Posts: 25
hi,

i am on creating FTP using Java.if client selects the server's folder to

receive in client side.The total files and folders,sub-folders in server

directory will be send to client over socket.Please tell me the how to send

folders over socket.

Thanks and Regards,

Krishnakumar.S
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41065
    
  43
FTP has facilities for sending files. Sending folders just means to send files and subfolders recursively for the selected folder. You need to make sure that any subfolders exist on the target machine, before transferring the files.

What do you have so far? Which FTP API are you using?


Ping & DNS - my free Android networking tools app
krish rajini
Greenhorn

Joined: Jul 02, 2008
Posts: 25
Sir,

i am not using any FTP API .i am on creating it by using Java sockets

and ServerSocket.when client wants a file from server it sends

dout.writeUTF("SEND").Then server reads the stream usign din.readUTF().

i have so many commands like SEND,RECEIVE,EXIST,NOT EXIST.

so that what i am cmng to say that i am not using any API.

when client selected the Server's folder.that particular folder name send

to server.After all conditions it must return the files and folders in it.
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
Sounds like your reinventing FTP. I'd at least read the doc for FTP to get all the protocol/commands you'll need.

A folder is a construct on an OS that allows you to organize files. Sending a folder would mean a sending a request to the reciever to create a folder by that name.
See the MKDIR and ChgDir commands.
[ July 29, 2008: Message edited by: Norm Radder ]
 
 
subject: Sending Folder over socket
 
Similar Threads
Servlet communication
SerialVersionUID
How to send Image over IP Socket?
Coordinating Processes Over Network
Please HELP Socket Amateur!