Downloading the book is a poor user experience at first place ... just let me download it right away or even better , just let me read that thing online... and make me download the book only if i'm interested in it. That's what user experience is about.
When did this get to be a Java forum with 27 "send me the codes" posts at the bottom of each thread?
User experience is indeed about making things smooth for viewers, but considering you could probably sell an eBook like this for $29 to $39, I think asking your email in exchange is fair! :) Especially considering you can unsubscribe with a click or two if you're unhappy about it.