Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Doubt abt Socket

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to find out the files from server is a directory or file
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
All of the following truths are shameless lies. But what about this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic