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.
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?
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