Ignoring file not found exceptions

This commit is contained in:
Ziver Koc 2014-08-08 12:52:55 +02:00
parent 5068ee37e3
commit 891051df3c

View file

@ -7,6 +7,7 @@ import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@ -88,18 +89,20 @@ public class UeBehaviourSurfing extends UeBehaviour {
StringBuilder content = new StringBuilder(); StringBuilder content = new StringBuilder();
while ((read = in.read(data)) != -1) { while ((read = in.read(data)) != -1) {
if(stopExecution()) if (stopExecution())
return; return;
totalRead += read; totalRead += read;
super.setProgress((float) totalRead / estimatedDataLength); super.setProgress((float) totalRead / estimatedDataLength);
super.setHandledIncomingData(read); super.setHandledIncomingData(read);
if(cont.parsable) if (cont.parsable)
content.append(new String(data, 0, read)); content.append(new String(data, 0, read));
if(content.length() > MAX_BUFFER_SIZE) if (content.length() > MAX_BUFFER_SIZE)
break; break;
} }
if(cont.parsable) if (cont.parsable)
getAdditionalContent(cont.url, content.toString(), urlList); getAdditionalContent(cont.url, content.toString(), urlList);
}catch(FileNotFoundException fnf){
log.warn("Unable to download: "+urlList.get(i).url);
}catch(IOException e){ }catch(IOException e){
log.warn(null, e); log.warn(null, e);
if(retException == null) retException = e; if(retException == null) retException = e;