Re: newbie question: the steps of a making a ping service

From: Raymond DeCampo (rdecampo_at_spam.twcny.spam.rr.spam.com.spam)
Date: 07/25/04


Date: Sat, 24 Jul 2004 22:22:15 GMT

lawrence wrote:
> I want to store a list of web addresses in a flat file, and then, once
> a week, have an application open that flat file, read the addresses
> into an array, then loop though that array and open the pages. The
> point of this service is mostly to call certain PHP scripts that are
> in certain web pages. I could do this as a shell script called by
> cron, but I think doing this in Java would be more portable, and I
> need to use this service from several servers.
>
> So I'm asking what are the steps involved in making this script?
>
> I need an application that runs forever on the server.
>
> It needs a timer to call it once a week.

Personally, I would defer this part to cron (Unix) or Scheduled Tasks
(Windows). If you are determined to do it in Java, look at
java.util.Timer or roll your own using Thread.sleep().

>
> It need to open a flat file.

Look at the java.io package.

>
> It needs to read a list into an array.

This is straight-forward. You may want to consider using a java.util.List.

>
> It needs to loop through that array.
>
> It needs to attempt to open the pages at the addresses in that array.

Look at java.net.URL.

>
> I've nearly no experiences with Java, so whatever advice you can give
> a beginner, I'm grateful.

I assume you have some experience in other languages. If so, this
should make a good first project for Java.

HTH,
Ray

-- 
XML is the programmer's duct tape.


Relevant Pages

  • Re: newbie question: the steps of a making a ping service
    ... >> I want to store a list of web addresses in a flat file, and then, once ... >> into an array, then loop though that array and open the pages. ... >> cron, but I think doing this in Java would be more portable, and I ... >> So I'm asking what are the steps involved in making this script? ...
    (comp.lang.java)
  • newbie question: the steps of a making a ping service
    ... I want to store a list of web addresses in a flat file, and then, once ... into an array, then loop though that array and open the pages. ... need to use this service from several servers. ... So I'm asking what are the steps involved in making this script? ...
    (comp.lang.java)
  • Re: newbie question: the steps of a making a ping service
    ... >> I want to store a list of web addresses in a flat file, and then, once ... >> cron, but I think doing this in Java would be more portable, and I ... >> need to use this service from several servers. ... >> So I'm asking what are the steps involved in making this script? ...
    (comp.lang.java)
  • Passing objects to a perl script via POST
    ... I am new at web page design and was wondering if I created an object in java ... script or an array can I pass it back to a perl script for processing. ... One example my be where a customer has the ability to select multiple items ...
    (comp.lang.perl.misc)
  • Re: Java Generic programming using subclassing
    ... Java nowhere guarantees that the elements of an array ... Now chances are that any Java ... > reference will be visible through the other. ... > eligible for garbage collection, and will in fact be collected before ...
    (comp.lang.java.programmer)