• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt abt Socket  RSS feed

 
krish rajini
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai i am on developing FTP Client and Server.

when client connected with server the server's particular

directory will be displayed to the client in JTree view.

so my doubt is tat using socket can we send the

JTree object of Server over n/w.(or) please tell me the solution to persist

the JTree object.
 
Soroj Margun
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi krish,

I think it's not a good idea to send the JTree over network. For FTP client, I suggest you to send only list of file data from server to client and let client construct JTree by itself.

Hope this help.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand this correctly, you're developing a GUI FTP client that uses Swing to display the server file system (using a JTree).

But an FTP client would use the FTP protocol to access the server, so I'm not sure what you mean by "send the JTree object of Server over n/w". Where does that fit into FTP?
 
krish rajini
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to find out the files from server is a directory or file
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to find out the files from server is a directory or file

That's what the FTP API can tell you. (By the way, which FTP library are you using? I recommend Apache Commons Net, but any other should work as well.) After you have connected successfully, you can retrieve a list of the files and directories that are in the top-level directory.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!