class DownloadStrategy {

    public void validInfoOnCompleted(@NonNull DownloadTask task, @NonNull DownloadStore store) {
        BreakpointInfo info = store.getAfterCompleted(task.getId());
        if (info == null) {
            info = new BreakpointInfo(task.getId(), task.getUrl(), task.getParentFile(),
                    task.getFilename());
            final long size;
            if (Util.isUriContentScheme(task.getUri())) {
                size = Util.getSizeFromContentUri(task.getUri());
            } else {
                final File file = task.getFile();
                if (file == null) {
                    size = 0;
                    Util.w(TAG, "file is not ready on valid info for task on complete state "
                            + task);
                } else {
                    size = file.length();
                }
            }
            info.addBlock(new BlockInfo(0, size, size));
        }
        DownloadTask.TaskHideWrapper.setBreakpointInfo(task, info);
    }

}