wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes accesing data from an IP address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "accesing data from an IP address" Watch "accesing data from an IP address" New topic
Author

accesing data from an IP address

Sonal Sharma
Ranch Hand

Joined: May 13, 2006
Posts: 62
Suppose I have developed a web application which is deployed on the webserver, now our LAN has 6 computers attached.IP Addresses of these computers is known to me. Now this application will keep on fetching the data after every 2 secs from all the PCs in this network, go to a particular folder in each of the computers and read the most recent file and upload its details to the database simultaneously.How to build this kind of application? Totally in a confused state of mind.Some code snippets or tutorials will be of great help.Please reply ASAP.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Hi Sonal,
suppose I have developed a web application which is deployed on the webserver, now our LAN has 6 computers attached.IP Addresses of these computers is known to me. Now this application will keep on fetching the data after every 2 secs from all the PCs in this network, go to a particular folder in each of the computers and read the most recent file and upload its details to the database simultaneously.How to build this kind of application? Totally in a confused state of mind.Some code snippets or tutorials will be of great help.Please reply ASAP.

I am not getting your question completely because first you say web server and
then LAN. How are they related.Please explain
Time being, it seems that you need some socket programming for your LAN.

Hope this helps


SCJP, SCWCD.
|Asking Good Questions|
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
What kind of access does the server have to those machines? If this is purely about files, I'd say either shared directories or FTP might work.


Ping & DNS - my free Android networking tools app
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Posted by Sonal Sharma in a new topic:

Yes all those computers are having ftp access.Do I need to configure my webserver for accesing data on those machines for reading files on those machines or IP addresses.How to do it?
Give some example.Like my web application is deployed on the webserver using JSF on Netbeans with Visual Web Pack.How to access the files in the specified directories on those machines simultaneously like my web application should be able to fetch data from the files on those machines after every 2 secs and upload that data to the database.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sonal Sharma
Ranch Hand

Joined: May 13, 2006
Posts: 62
whether I should use ftp or rmi ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
RMI won't help with this.

You don't need to configure the web server, you just need to write the code that accesses those 6 machines via FTP. Thanks to the Apache Commons Net library, that's pretty easy. The javadocs of the org.apache.commons.net.ftp.FTPClient class show the basics of an FTP client.

Mind you, that's assuming that those 6 machines each have an FTP SERVER running; just having FTP CLIENTS on them won't help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: accesing data from an IP address