code: public static void writeTokenToFile(Token<? extends TokenIdentifier> token, Path tokenFilePath,
        Configuration configuration) throws IOException {
      Credentials credentials = new Credentials();
      credentials.addToken(token.getService(), token);
      credentials.writeTokenStorageFile(tokenFilePath, configuration);
    }
docs: Write a {@link Token} to a given file.
  
  @param token the token to write
  @param tokenFilePath the token file path
  @param configuration a {@link Configuration} object carrying Hadoop configuration properties
  @throws IOException