class DownloadStrategy {

    public void validFilenameFromResponse(@Nullable String responseFileName,
                                          @NonNull DownloadTask task,
                                          @NonNull BreakpointInfo info) throws IOException {
        if (Util.isEmpty(task.getFilename())) {
            final String filename = determineFilename(responseFileName, task);

            // Double check avoid changed by other block.
            if (Util.isEmpty(task.getFilename())) {
                synchronized (task) {
                    if (Util.isEmpty(task.getFilename())) {
                        task.getFilenameHolder().set(filename);
                        info.getFilenameHolder().set(filename);
                    }

                }
            }
        }
    }

}