public List<DLFolder> getAncestors() throws PortalException, SystemException {

    List<DLFolder> ancestors = new ArrayList<DLFolder>();

    DLFolder folder = this;

    while (!folder.isRoot()) {
      folder = folder.getParentFolder();

      ancestors.add(folder);
    }

    return ancestors;
  }
  @Override
  public List<DLFolder> getAncestors() throws PortalException, SystemException {

    List<DLFolder> ancestors = new ArrayList<DLFolder>();

    DLFolder folder = this;

    while (!folder.isRoot()) {
      try {
        folder = folder.getParentFolder();

        ancestors.add(folder);
      } catch (NoSuchFolderException nsfe) {
        if (folder.isInTrash()) {
          break;
        }

        throw nsfe;
      }
    }

    return ancestors;
  }