I have created a Swing app that users collect remote data through (as well as other things). Once the day is done, multiple users connect to the internet and select the "Synch" button. Objects then query the local DB and generate XML files from each table in the local DB.
Now that the XML files are created, I need to upload the files to the server app where they will be parsed and loaded into the main DB. The next morning, the server app will then download all of the files to the user directory where they will be parsed and loaded into the user's local DB.
So, I have local files and remote files. I need to pass them to each respective location and have no web-app that will take care of this. I am assuming that I will use a socket connection (right?). Can anyone point me to resources that will help me to figure out how to do this uploading and downloading. BTW, there will be no browse feature in this app. The uploading and downloading must happen automatically based on logic in the app.
actually, if this is a web app, you'll likely want to use higher-level APIs corresponding to www/http concepts, rather than the raw sockets those are built on. look into the java.net package and its classes; the HttpURLConnection class looks promising to me.
if you're willing to go beyond Sun's basic API, then Jakarta Commons looks like it might have a few useful classes. its FileUpload and HttpClient might do things you will want done, perhaps.
posted 14 years ago
Thanks very much. I will check into using those classes and see what looks best. I don't have a web-app. There is a web app but that one is for connected users. In this case, there is not even a GUI on the server. Just the listener and a timer that polls directories for new files as well as generates files at day's end. I could build a web-app though and forgo the socket. Thanks for pointing me in a direction that might be useful.
All the best, Al
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
professionally read, modify and write PDF files from Java