3 Replies Latest reply: Aug 2, 2010 8:24 PM by EJP RSS

    Java Socket Directory Content Checking

      I want to develop an app where I can check the content of a directory on one box, if it sees anything then move the content to another box. I think socket is the way to go. How can i start it? Are there any examples on line? Please help...

        • 1. Re: Java Socket Directory Content Checking
          If the two servers are on the same LAN, use java.io.File to read the directory and list the contents. Then you can execute your move using a few different techniques. If it's a remote server not on the same LAN, it depends on your setup. Maybe you have a web page that will list the files and you can write a java class to read that web page and then process. It's hard to determine without knowing more information. I'm not so sure a socket is the best approach, but again, without knowing more information it is hard to determine that.
          • 2. Re: Java Socket Directory Content Checking
            This first box, the one you want to watch: what platform is it running? Can you install any services on it? Do you want to write the application, or do you need the application? Because the problem's already been solved by a number of technologies, such as rsync. Do you really want this functionality, or is this an idea to solve a different problem? This sounds like a pretty bog-standard bit of integration, you wouldn't believe how often people think they need to move a file from one place to another, but really don't. There are a number of ways to move forward. Give us some background!
            • 3. Re: Java Socket Directory Content Checking
              If you're on a LAN, use the Replication service.

              But moving files around between computers is a terrible idea really. Why do you think you have to do it at all?