package Ġorg . ny pl . simpl ified . books . borrow ing . internal Ċ Ċ import Ġone . ir rad ia . mime . api . MIME Compatibility Ċ import Ġone . ir rad ia . mime . api . MIME Type Ċ import Ġorg . ny pl . simpl ified . accounts . api . Account Readable Type Ċ import Ġorg . ny pl . simpl ified . books . borrow ing . Borrow Context Type Ċ import Ġorg . ny pl . simpl ified . books . borrow ing . sub tasks . Borrow Sub task Factory Type Ċ import Ġorg . ny pl . simpl ified . books . borrow ing . sub tasks . Borrow Sub task Type Ċ import Ġorg . ny pl . simpl ified . books . formats . api . Standard Format Names . generic EP UB Files Ċ import Ġorg . ny pl . simpl ified . books . formats . api . Standard Format Names . generic PDF Files Ċ import Ġjava . net . URI Ċ Ċ /** Ċ Ġ* ĠA Ġtask Ġthat Ġdownloads Ġa Ġfile Ġdirectly Ġand Ġsaves Ġit Ġto Ġthe Ġbook Ġdatabase . ĠIt Ġ_ does Ġnot _ Ċ Ġ* Ġdo Ġany Ġspecial Ġlogic Ġsuch Ġas Ġaudio Ġbook Ġmanifest Ġfulfill ment , ĠAdobe ĠA CS Ġoperations , Ġor Ċ Ġ* Ġanything Ġelse . Ċ Ġ*/ Ċ Ċ class ĠB orrow Direct Download Ġprivate Ġconstructor () Ġ: ĠB orrow Sub task Type Ġ{ ĊĊĠ Ġcompanion Ġobject Ġ: ĠB orrow Sub task Factory Type Ġ{ ĊĠĠĠ Ġoverride Ġval Ġname : ĠString ĊĠĠĠĠĠ Ġget () Ġ= Ġ" Direct ĠHTTP ĠDownload " ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Sub task (): ĠB orrow Sub task Type Ġ{ ĊĠĠĠĠĠ Ġreturn ĠB orrow Direct Download () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġis Applicable For ( ĊĠĠĠĠĠ Ġtype : ĠMIME Type , ĊĠĠĠĠĠ Ġtarget : ĠURI ?, ĊĠĠĠĠĠ Ġaccount : ĠAccount Readable Type ? ĊĠĠĠ Ġ): ĠBoolean Ġ{ ĊĠĠĠĠĠ Ġif Ġ( MIME Compatibility . is Compatible Strict Without Attributes ( type , Ġgeneric EP UB Files )) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġif Ġ( MIME Compatibility . is Compatible Strict Without Attributes ( type , Ġgeneric PDF Files )) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġreturn Ġfalse ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġexecute ( context : ĠB orrow Context Type ) Ġ{ ĊĠĠĠ Ġcontext . task Recorder . begin New Step (" Downloading Ġdirectly ...") ĊĠĠĠ Ġcontext . book Download Is Running ( ĊĠĠĠĠĠ Ġ" Request ing Ġdownload ...", ĊĠĠĠĠĠ Ġreceived Size Ġ= Ġ 0 , ĊĠĠĠĠĠ Ġbytes PerSecond Ġ= Ġ 0 ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠB orrow HTTP . download ( context ) ĊĠ Ġ} Ċ } Ċ