public static synchronized HdfsApi connectToHDFSApi(ViewContext context) throws HdfsApiException {
    ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(HdfsUtil.class.getClassLoader());
    try {
      ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(context);
      return getHdfsApi(context, configurationBuilder);
    } finally {
      Thread.currentThread().setContextClassLoader(currentClassLoader);
    }
  }
Factory of HdfsApi for specific ViewContext
@param context ViewContext that contains connection credentials
@return HdfsApi object
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsUtil.java