public void unregisterAll(String path, boolean under, boolean unregisterSources) {
    Url url = toUrl(path);

    for (ContentEntry eachEntry : myRootModel.getContentEntries()) {
      if (unregisterSources) {
        for (SourceFolder eachFolder : eachEntry.getSourceFolders()) {
          String ancestor = under ? url.getUrl() : eachFolder.getUrl();
          String child = under ? eachFolder.getUrl() : url.getUrl();
          if (isEqualOrAncestor(ancestor, child)) {
            eachEntry.removeSourceFolder(eachFolder);
          }
        }
      }

      for (ExcludeFolder eachFolder : eachEntry.getExcludeFolders()) {
        String ancestor = under ? url.getUrl() : eachFolder.getUrl();
        String child = under ? eachFolder.getUrl() : url.getUrl();

        if (isEqualOrAncestor(ancestor, child)) {
          if (eachFolder.isSynthetic()) {
            getCompilerExtension().setExcludeOutput(false);
          } else {
            eachEntry.removeExcludeFolder(eachFolder);
          }
        }
      }
    }
  }
 public boolean hasRegisteredSourceSubfolder(File f) {
   String url = toUrl(f.getPath()).getUrl();
   for (ContentEntry eachEntry : myRootModel.getContentEntries()) {
     for (SourceFolder eachFolder : eachEntry.getSourceFolders()) {
       if (isEqualOrAncestor(url, eachFolder.getUrl())) return true;
     }
   }
   return false;
 }
  public boolean hasCollision(String sourceRootPath) {
    Url url = toUrl(sourceRootPath);

    for (ContentEntry eachEntry : myRootModel.getContentEntries()) {
      for (SourceFolder eachFolder : eachEntry.getSourceFolders()) {
        String ancestor = url.getUrl();
        String child = eachFolder.getUrl();
        if (isEqualOrAncestor(ancestor, child) || isEqualOrAncestor(child, ancestor)) {
          return true;
        }
      }

      for (ExcludeFolder eachFolder : eachEntry.getExcludeFolders()) {
        String ancestor = url.getUrl();
        String child = eachFolder.getUrl();

        if (isEqualOrAncestor(ancestor, child) || isEqualOrAncestor(child, ancestor)) {
          return true;
        }
      }
    }

    return false;
  }