I'm not sure if the idea makes sense or not, but I'd strongly recommend
against using TFTP... way too many security holes. Use a properly
configured
FTP server instead.
---
Kevin W. Wall Light Source Software Labs, Inc.
[EMAIL PROTECTED] Phone: 614.337.0395 (business) / 614.798.6371 (days)
"It's easier to port a shell than a shell script." -- Larry (not my brother)
Wall
> -----Original Message-----
> From: Danny Rubis [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 25, 1999 11:22 PM
> To: [EMAIL PROTECTED]
> Subject: Servlet/ftp Design ?
>
>
> Hey!
>
> Given more than 100 computers collecting test lab data. Each has a
> directory named C shared-out to the network, where log files
> are written
> out to flat files. Another computer collects all of the data
> from each
> of the lab computers and stores it in a database. A servlet provides
> access to the data to the Web browser. The log files are not sent to
> the database computer, but reside on the test lab computers.
>
> Does it make sense to do this:
> Install a TFTP server on each of the test lab computers.
> Instantiate a URL connection.
> Get the log file.
>
> The servlet code to get the log files like this:
>
> ...
> String host ="Lab1"; // the name of the lab
> computer
> String log="Log1.log"; //the log file
> String url = "ftp://" +host+ "/" +log";
> try { this.theURL = new URL(url); }
> catch ( MalformedURLException e) {
> System.out.println("Bad URL: " + theURL);
> }
> ...
> ...
> URLConnection conn = null;
> DataInputStream data = null;
> String line;
> StringBuffer buf = new StringBuffer();
>
> try {
> conn = this.theURL.openConnection();
> conn.connect();
>
> //Connection opened...
> data = new DataInputStream(new BufferedInputStream(
> conn.getInputStream()));
>
> // get the log file
> while ((line = data.readLine()) != null) {
> buf.append(line + "\n");
> }
> }
> catch (IOException e) {
> System.out.println("IO Error:" + e.getMessage());
> }
>
> ______________________________________________________________
> _____________
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html