/* (non-Javadoc)
* @see java.util.Observer#update(java.util.Observable, java.lang.Object)
*/
public void update(Observable o, Object arg)
{
Download download = _downloads.get( _downloads.indexOf(o) );
switch( download.getStatus() )
{
case Download.DOWNLOADING:
//case Download.PAUSED:
break;
case Download.CANCELLED:
case Download.ERROR:
{
File file = new File( download.getDownloadedFilePosition() );
file.delete();
}
break;
case Download.COMPLETE:
{
download.deleteObservers();
_downloads.remove(download);
File from = new File( download.getDownloadedFilePosition() );
String storeFile = download.getStoreFilePosition();
File to = new File( storeFile );
from.renameTo( to );
addByFilename( storeFile );