Back to project page EnklawaPlayer.
The source code is released under:
GNU General Public License
If you think the Android project EnklawaPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package macbury.pod.managers.download; // w w w . j a v a 2 s . c o m import com.koushikdutta.async.future.Future; import com.koushikdutta.ion.Ion; import java.io.File; import macbury.pod.db.models.Episode; import macbury.pod.db.models.EpisodeFile; import macbury.pod.managers.App; /** * Created by macbury on 13.09.14. */ public class DownloadEpisode { private EpisodeFile episodeFile; private Future<File> download; public int progress = 0; public DownloadEpisode(EpisodeFile episodeFile, DownloadManager manager) { this.episodeFile = episodeFile; this.download = Ion.with(manager.getContext()) .load(episodeFile.episode.mp3) .progress(manager) .write(App.current().storage.getEpisodeFile(episodeFile)) .setCallback(manager); } public Future<File> getDownload() { return download; } public EpisodeFile getEpisodeFile() { return episodeFile; } public int getEpisodeFileId() { return episodeFile.id; } public Episode getEpisode() { return episodeFile.episode; } }