}
catch (UnsupportedEncodingException e1) {
//Do nothing and process next.
}
catch (Throwable e) {
Logger.log(new LogEvent(LOGID,
"Error while loading downloads. " +
"One download may not have been added to the list.", e));
}
}
// This is set to true by default, but once the downloads have been loaded, we have no reason to ever
// to do this check again - we only want to do it once to upgrade the state of existing downloads
// created before this code was around.
COConfigurationManager.setParameter("Set Completion Flag For Completed Downloads On Start", false);
//load pause/resume state
ArrayList pause_data = (ArrayList)map.get( "pause_data" );
if( pause_data != null ) {
try { paused_list_mon.enter();
for( int i=0; i < pause_data.size(); i++ ) {
Object pd = pause_data.get(i);
byte[] key;
boolean force;
if ( pd instanceof byte[]){
// old style, migration purposes
key = (byte[])pause_data.get( i );
force = false;
}else{
Map m = (Map)pd;
key = (byte[])m.get("hash");
force = ((Long)m.get("force")).intValue() == 1;
}
paused_list.add( new Object[]{ new HashWrapper( key ), new Boolean( force )} );
}
}
finally { paused_list_mon.exit(); }
}
// Someone could have mucked with the config file and set weird positions,
// so fix them up.
fixUpDownloadManagerPositions();
Logger.log(new LogEvent(LOGID, "Loaded " + managers_cow.size()
+ " torrents"));
}catch( Throwable e ){
// there's been problems with corrupted download files stopping AZ from starting
// added this to try and prevent such foolishness