public DownloadWebPackageResponse download(DownloadWebPackageRequest request) {
    logger.info(String.format("begin download WebPackage: %s", request));

    DownloadWebPackageResponse response = new DownloadWebPackageResponse();

    File webPackageFile = WebPackageUtil.newWebPackageFile(request.getToken());
    response.setFileSystemResource(new FileSystemResource(webPackageFile));
    response.success();

    logger.info(String.format("end download WebPackage: %s", response));

    return response;
  }
  public UploadWebPackageResponse upload(UploadWebPackageRequest request) {
    logger.info(String.format("begin upload WebPackage: %s", request));

    UploadWebPackageResponse response = new UploadWebPackageResponse();

    File webPackageFile = WebPackageUtil.newWebPackageFile(request.getToken());
    try {
      Files.write(request.getFile().getBytes(), webPackageFile);
      response.success();
      saveOrUpdateAppVersion(request.getToken());
    } catch (IOException e) {
      response.fail(e.toString());
      logger.error(String.format("error when upload: %s", request), e);
    }

    logger.info(String.format("end upload WebPackage: %s", response));

    return response;
  }