net.spy.net
Class URLWatcher

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.net.URLWatcher

public final class URLWatcher
extends SpyObject

URLWatcher watches URLs and provides access to the most recent data from the URL.


Method Summary
 java.lang.String getContent(java.net.URL u)
          Get the content (as a String) for a given URL.
static URLWatcher getInstance()
          Get the static instance of URLWatcher.
 boolean isWatching(java.net.URL u)
          Find out if this URLWatcher is watching a given URL.
 void shutdown()
          Instruct the URLWatcher to stop URLWatching.
 void startWatching(URLItem u)
          Start watching the given URL.
 java.lang.String toString()
          String me.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static URLWatcher getInstance()
Get the static instance of URLWatcher.

Returns:
the URLWatcher

toString

public java.lang.String toString()
String me.

Overrides:
toString in class java.lang.Object

isWatching

public boolean isWatching(java.net.URL u)
Find out if this URLWatcher is watching a given URL.

Parameters:
u - the URL to test
Returns:
true if the URL is already being watched

startWatching

public void startWatching(URLItem u)
Start watching the given URL.

Parameters:
u - The item to watch

shutdown

public void shutdown()
Instruct the URLWatcher to stop URLWatching.


getContent

public java.lang.String getContent(java.net.URL u)
                            throws java.io.IOException
Get the content (as a String) for a given URL.

Parameters:
u - The URL whose content we want
Returns:
The String contents, or null if none could be retreived
Throws:
java.io.IOException - if there was a problem updating the URL


Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.