code: public static Path getGcsOutputPath(Configuration conf) throws IOException {
      Job tempJob = new JobConfigurationAdapter(conf);
  
      // Error if the output path is missing.
      Path outputPath = FileOutputFormat.getOutputPath(tempJob);
      if (outputPath == null) {
        throw new IOException("FileOutputFormat output path not set.");
      }
  
      // Error if the output file system isn't GCS.
      FileSystem fs = outputPath.getFileSystem(conf);
      if (!(fs instanceof GoogleHadoopFileSystemBase)) {
        throw new IOException("Output FileSystem must derive from GoogleHadoopFileSystemBase.");
      }
  
      return outputPath;
    }
docs: Gets the stored GCS output path in the configuration.
  
  @param conf the configuration to reference the keys from.
  @return the stored output path in the configuration.
  @throws IOException if the output path isn't set in the configuration, or the output path's
  file system isn't derived from GoogleHadoopFileSystemBase.