JNUSTool/src/main/java/de/mas/wiiu/jnus/jnustool/FEntryDownloader.java

38 lines
769 B
Java
Raw Normal View History

2019-04-15 11:45:15 +02:00
package de.mas.wiiu.jnus.jnustool;
2016-02-02 19:38:53 +01:00
2016-02-01 20:54:01 +01:00
import java.util.concurrent.Callable;
public class FEntryDownloader implements Callable<Integer>{
FEntry f;
Progress progress = null;
2016-02-01 20:54:01 +01:00
public void setTitle(FEntry f){
this.f = f;
}
public FEntryDownloader(FEntry f,Progress fatherProgress){
2016-02-01 20:54:01 +01:00
setTitle(f);
createProgressListener(fatherProgress);
}
2016-02-01 20:54:01 +01:00
private void createProgressListener(Progress fatherProgress) {
if(fatherProgress != null){
progress = new Progress();
fatherProgress.add(progress);
progress.addTotal(f.getFileLength());
}
}
2016-02-02 19:38:53 +01:00
@Override
public Integer call() throws Exception {
try{
f.downloadAndDecrypt(progress);
}catch(Exception e){
e.printStackTrace();
throw e;
}
2016-02-02 19:38:53 +01:00
return null;
}
2016-02-01 20:54:01 +01:00
}