code: public WritableByteChannel create(URI path, CreateFileOptions options) throws IOException {
      logger.atFine().log("create(%s)", path);
      Preconditions.checkNotNull(path, "path could not be null");
      if (FileInfo.isDirectoryPath(path)) {
        throw new IOException(
            String.format("Cannot create a file whose name looks like a directory. Got '%s'", path));
      }
  
      // Check if a directory of that name exists.
      if (options.checkNoDirectoryConflict()) {
        URI dirPath = FileInfo.convertToDirectoryPath(pathCodec, path);
        if (exists(dirPath)) {
          throw new FileAlreadyExistsException("A directory with that name exists: " + path);
        }
      }
  
      // Ensure that parent directories exist.
      if (options.ensureParentDirectoriesExist()) {
        URI parentPath = getParentPath(path);
        if (parentPath != null) {
          mkdirs(parentPath);
        }
      }
  
      return createInternal(path, options);
    }
docs: Creates and opens an object for writing.
  
  @param path Object full path of the form gs://bucket/object-path.
  @return A channel for writing to the given object.
  @throws IOException