code: private void getSheetAsFile(long id, PaperSize paperSize, OutputStream outputStream, String contentType)
              throws SmartsheetException {
          Util.throwIfNull(outputStream, contentType);
  
          String path = "sheets/" + id;
          if (paperSize != null) {
              path += "?paperSize=" + paperSize;
          }
  
          HttpRequest request;
          request = createHttpRequest(this.getSmartsheet().getBaseURI().resolve(path), HttpMethod.GET);
          request.getHeaders().put("Accept", contentType);
  
          com.smartsheet.api.internal.http.HttpResponse response = getSmartsheet().getHttpClient().request(request);
  
          switch (response.getStatusCode()) {
          case 200:
              try {
                  copyStream(response.getEntity().getContent(), outputStream);
              } catch (IOException e) {
                  throw new SmartsheetException(e);
              }
              break;
          default:
              handleError(response);
          }
  
          getSmartsheet().getHttpClient().releaseConnection();
      }
docs: Get a sheet as a file.
  
  Exceptions:
  - InvalidRequestException : if there is any problem with the REST API request
  - AuthorizationException : if there is any problem with the REST API authorization(access token)
  - ResourceNotFoundException : if the resource can not be found
  - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
  - SmartsheetRestException : if there is any other REST API related error occurred during the operation
  - SmartsheetException : if there is any other error occurred during the operation
  
  @param id the id
  @param paperSize the paper size
  @param outputStream the OutputStream to which the Excel file will be written
  @param contentType the content type
  @return the sheet as file
  @throws SmartsheetException the smartsheet exception