protected File resolveDirectory(String directoryName, String stack, String service) {
    File directory = new File(getAbsolutePath() + File.separator + directoryName);
    if (directory.isDirectory()) {
      String[] files = directory.list();
      int fileCount = files.length;
      if (fileCount > 0) {
        LOG.debug("Service {} folder for service {} in {} has been resolved to {}", directoryName, service, stack, directory);
        return directory;
      }
      else {
        LOG.debug("Service folder {} is empty.", directory);
      }
    }
    else {
      LOG.debug("Service folder {}does not exist.", directory);
    }
    return null;
  }
@param directoryName
@param stack
@param service
@return the directory if it exists and is not empty
ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java