code: public static boolean isFolderWithMacros(CmsObject cms, String folderPathRoot) {
  
          if (!CmsResource.isFolder(folderPathRoot)) {
              folderPathRoot = folderPathRoot.concat("/");
          }
          try {
              cms.readResource(folderPathRoot + MACRO_FOLDER);
              cms.readResource(folderPathRoot + MACRO_FOLDER + "/" + BUNDLE_NAME + "_desc");
          } catch (CmsException e) {
              return false;
          }
          return true;
      }
docs: Method to check if a folder under given path contains a bundle for macro resolving.<p>
  
  @param cms CmsObject
  @param folderPathRoot root path of folder
  @return true if macros bundle found