• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compare directories on separate workstations  RSS feed

 
dan schroeder
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a terrible time trying to come up with a way to compare two directories stored on separate computers. Any tips would be greatly appreciated.

A little background: I am writing an rmi application that provides file sharing an backups of music, videos pictures, etc. The problem is I want to compare a directory on the client machine against a directory on the server so that I can display what is missing in a JTree. I created a class that takes two files as arguments and creates tree nodes from them that are color coordinated. This works great as long as I run the client and server on the same machine. I didn't realize that I couldn't pass the directory stored on the client machine as a "File" to the server and have all the subdirectories intact.

I assume I will have to come up with some way of representing the directory and all is subdirectories in some way that I can pass to the server. However I am at a loss at this point. Any suggestions would be appreciated.

Thanks in advance,
Dan
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DefaultMutableTreeNode is Serializable* so you can send your entire tree structure that way.

* provided the user data is Serializable of course.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!