de.vxart.zipupdate
Class UpdateLocation

java.lang.Object
  extended by de.vxart.zipupdate.UpdateLocation

public class UpdateLocation
extends java.lang.Object

Encapsulates an URL-based location which holds the up-to-date version of an archive and provides the fine-grained access functionality to a remote archive's contents.

Author:
Philipp Reichart, philipp.reichart@vxart.de

Constructor Summary
UpdateLocation(java.net.URL url)
          Creates a new UpdateLocation sourced from the specified URL.
 
Method Summary
 void addProgressListener(ProgressListener listener)
           
 void fetchData(java.util.Map<Resource,java.lang.String> diff)
          Fetches any data required by the specified diff into a temporary cache.
 java.util.Iterator<Resource> getData(java.util.Map<Resource,java.lang.String> diff)
          Provides an Iterator over any remote Resources that are flagged as ADD or UPDATE.
 java.util.Set<Resource> getResources()
          Fetches the resources available from this UpdateLocation
 java.net.URL getUrl()
           
 void removeProgressListener(ProgressListener listener)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UpdateLocation

public UpdateLocation(java.net.URL url)
Creates a new UpdateLocation sourced from the specified URL.

Parameters:
url - the URL to use as source of the up-to-date data
Method Detail

getUrl

public java.net.URL getUrl()

getResources

public java.util.Set<Resource> getResources()
                                     throws java.io.IOException
Fetches the resources available from this UpdateLocation

Returns:
the resources available from this UpdateLocation
Throws:
java.io.IOException

fetchData

public void fetchData(java.util.Map<Resource,java.lang.String> diff)
               throws java.io.IOException
Fetches any data required by the specified diff into a temporary cache.

Parameters:
diff - the diff to fetch data for
Throws:
java.io.IOException

getData

public java.util.Iterator<Resource> getData(java.util.Map<Resource,java.lang.String> diff)
                                     throws java.io.IOException
Provides an Iterator over any remote Resources that are flagged as ADD or UPDATE. A call to the hasNext() or next() methods of the Iterator returned by this method will automatically close the InputStream of the previous Resource.

Throws:
java.io.IOException

addProgressListener

public void addProgressListener(ProgressListener listener)

removeProgressListener

public void removeProgressListener(ProgressListener listener)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object