code: public static Path getDataPublisherFinalDir(State state, int numBranches, int branchId) {
      String dataPublisherFinalDirKey =
          ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, numBranches, branchId);
      Preconditions.checkArgument(state.contains(dataPublisherFinalDirKey),
          "Missing required property " + dataPublisherFinalDirKey);
  
      if (state.getPropAsBoolean(ConfigurationKeys.DATA_PUBLISHER_APPEND_EXTRACT_TO_FINAL_DIR,
          ConfigurationKeys.DEFAULT_DATA_PUBLISHER_APPEND_EXTRACT_TO_FINAL_DIR)) {
        return new Path(state.getProp(
            ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, numBranches, branchId)),
            WriterUtils.getWriterFilePath(state, numBranches, branchId));
      } else {
        return new Path(state.getProp(
            ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, numBranches, branchId)));
      }
    }
docs: Get the {@link Path} corresponding the to the directory a given {@link org.apache.gobblin.publisher.BaseDataPublisher} should
  commits its output data. The final output data directory is determined by combining the
  {@link ConfigurationKeys#DATA_PUBLISHER_FINAL_DIR} and the {@link ConfigurationKeys#WRITER_FILE_PATH}.
  @param state is the {@link State} corresponding to a specific {@link org.apache.gobblin.writer.DataWriter}.
  @param numBranches is the total number of branches for the given {@link State}.
  @param branchId is the id for the specific branch that the {@link org.apache.gobblin.publisher.BaseDataPublisher} will publish.
  @return a {@link Path} specifying the directory where the {@link org.apache.gobblin.publisher.BaseDataPublisher} will publish.