code: public boolean doesBucketExist(DoesBucketExistRequest request) {
          checkNotNull(request, "request should not be null.");
          try {
              this.invokeHttpClient(this.createRequest(request, HttpMethodName.HEAD), BosResponse.class);
              return true;
          } catch (BceServiceException e) {
              // Forbidden means that the bucket exists.
              if (e.getStatusCode() == StatusCodes.FORBIDDEN) {
                  return true;
              }
              if (e.getStatusCode() == StatusCodes.NOT_FOUND) {
                  return false;
              }
              throw e;
          }
      }
docs: Checks if the specified bucket exists. Bos buckets are named in a
  global namespace; use this method to determine if a specified bucket name
  already exists, and therefore can't be used to create a new bucket.
  
  <p>
  If invalid security credentials are used to execute this method, the
  client is not able to distinguish between bucket permission errors and
  invalid credential errors, and this method could return an incorrect
  result.
  
  @param request The request object containing all options for checking a Bos bucket.
  @return The value <code>true</code> if the specified bucket exists in Bos;
  the value <code>false</code> if there is no bucket in Bos with that name.