org.gvsig.remoteclient.taskplanning.retrieving
Class URLRetrieveTask

java.lang.Object
  extended by org.gvsig.remoteclient.taskplanning.retrieving.URLRetrieveTask
All Implemented Interfaces:
IRunnableTask

public class URLRetrieveTask
extends java.lang.Object
implements IRunnableTask

Clase para bajar ficheros en un thread independiente. La idea (y parte del código) está tomada de EarthFlicks

Author:
Luis W. Sevilla (sevilla_lui@gva.es)
See Also:
http://today.java.net/lpt/a/212

Constructor Summary
URLRetrieveTask(URLRequest request, RetrieveListener listener)
           
 
Method Summary
 void addRetrieveListener(RetrieveListener l)
           
 void cancel()
          Cancels the current execution, if any, of this task.
 void execute()
          Executes this task's operations.
 java.util.Vector getListeners()
           
 URLRequest getRequest()
           
 long getTaskTimeout()
          Returns the timeout set to this task in milliseconds
 boolean isRunning()
          Tells if the task is on execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLRetrieveTask

public URLRetrieveTask(URLRequest request,
                       RetrieveListener listener)
Method Detail

execute

public void execute()
Description copied from interface: IRunnableTask
Executes this task's operations.

Specified by:
execute in interface IRunnableTask

addRetrieveListener

public void addRetrieveListener(RetrieveListener l)

cancel

public void cancel()
Description copied from interface: IRunnableTask
Cancels the current execution, if any, of this task. Should have no effect if the task is not executing anything.

Specified by:
cancel in interface IRunnableTask

isRunning

public boolean isRunning()
Description copied from interface: IRunnableTask
Tells if the task is on execution.

Specified by:
isRunning in interface IRunnableTask
Returns:
true if the task is busy, false otherwise.

getRequest

public URLRequest getRequest()

getListeners

public java.util.Vector getListeners()

getTaskTimeout

public long getTaskTimeout()
Description copied from interface: IRunnableTask
Returns the timeout set to this task in milliseconds

Specified by:
getTaskTimeout in interface IRunnableTask
Returns:
the amount of milliseconds to wait until the task will be considered as unsuccessful, or 0 or less to say that task can wait forever.


Copyright © 2004-2013 gvSIG. All Rights Reserved.