Direct direct;
if (dinfo.multipart()) {
// multi part? overwrite.
direct = new DirectMultipart(dinfo, targetFile);
} else if (dinfo.getRange()) {
// range download? try to resume download from last
// position
if (targetFile.exists() && targetFile.length() != dinfo.getCount())
targetFile = null;