Thanks, Jim:
I am writing both client code and server code (Websphere), so I don't have problem with protocol problem. The client will use HTTP URLConnection to request the server, and get response. A file or directory will be set up on server side to either get input to a file, or write input to the file and insert this file into the directory.
If I use directory-based queue to queue up incoming files, every time the client request asks for new files in the directory, these files will be retrived and sent through response, after that these files will be deleted from the directory, so when the client poll this directory-based queue again, it will get only new files or nothing, I don't have to worry about old content any more.
Is there any way to implement the directory-based file queue?
Any input will be appreciated. Thanks!
Originally posted by Jim Yingst:
If you're running some sort of Java program on the same system as the file (i.e. some sort of server program - JSP/servlet/whatever) then File.lastModified() is probably what you want. If you're talking about trying to learn about this "remote file" from another computer, where you don't have any control over the server's codebase, well, you need to konw what sort of server they're running. Does it accept HTTP requests? FTP? Some custom protocol using sockets? We need more details. (Unless lastModified() was already an adequate answer.)