private Collection<KerberosServiceDescriptor> getServiceDescriptors(StackInfo stack) throws IOException {
    Collection<KerberosServiceDescriptor> serviceDescriptors = new ArrayList<>();
    for (ServiceInfo service : stack.getServices()) {
      File descriptorFile = service.getKerberosDescriptorFile();
      if (descriptorFile != null) {
        KerberosServiceDescriptor descriptor =
            kerberosServiceDescriptorFactory.createInstance(descriptorFile, service.getName());

        if (descriptor != null) {
          serviceDescriptors.add(descriptor);
        }
      }
    }
    return serviceDescriptors;
  }
Get a collection of all service descriptors for the specified stack.

@param stack  stack name

@return collection of all service descriptors for the stack; will not return null

@throws IOException if unable to read or parse a descriptor file
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java