docs: private void streamAndMove(InputStream is, File destFile) throws IOException {
          if (!tempAndMove) {
              stream(is, destFile);
          } else {
              //create parent directory
              downloadTaskDir.mkdirs();
  
              //create name of temporary file
              File tempFile = File.createTempFile(destFile.getName(), ".part",
                      this.downloadTaskDir);
  
              //stream and move
              stream(is, tempFile);
              if (destFile.exists()) {
                  //Delete destFile if it exists before renaming tempFile.
                  //Otherwise renaming might fail.
                  if (!destFile.delete()) {
                      throw new IOException("Could not delete old destination file '" +
                              destFile.getAbsolutePath() + "'.");
                  }
              }
              if (!tempFile.renameTo(destFile)) {
                  throw new IOException("Failed to move temporary file '" +
                          tempFile.getAbsolutePath() + "' to destination file '" +
                          destFile.getAbsolutePath() + "'.");
              }
          }
      }