Removes all the entries currently in neverDeletePaths
and add the new ones specified
428307
void reloadWhitelist() throws IOException {

    // read the entire whitelist into memory outside the
    // FSNamessytem lock.
    //
    LinkedList<String> paths = new LinkedList<String>();
    FileInputStream fstream = new FileInputStream(whitelistFile);
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    int count = 0;
    while (true) {
      String str = br.readLine();
      if (str == null) {
        break;                  // end of file
      }
      str = str.trim();         // remove all whitespace from start and end
      if (str.startsWith("#")) {
        continue;               // ignore lines with starting with #
      }
      paths.add(str);
      LOG.info("Whitelisted directory [" + count + "] " + str);
      count++;
    }
    in.close();

    // acquire the writelock and insert newly read entries into 
    // the Namenode's configuration.
    namesys.writeLock();
    try {
      namesys.neverDeletePaths.clear();
      for (String s: paths) {
        namesys.neverDeletePaths.add(s);
      }
    } finally {
      namesys.writeUnlock();
    }
  }
663639
def remove_existing_fpaths(fpath_list, verbose=VERBOSE, quiet=QUIET,
                           strict=False, print_caller=PRINT_CALLER,
                           lbl='files'):
    
    import utool as ut
    if print_caller:
        print(util_dbg.get_caller_name(range(1, 4)) + ' called remove_existing_fpaths')
    fpath_list_ = ut.filter_Nones(fpath_list)
    exists_list = list(map(exists, fpath_list_))
    if verbose:
        n_total = len(fpath_list)
        n_valid = len(fpath_list_)
        n_exist = sum(exists_list)
        print('[util_path.remove_existing_fpaths] request delete of %d %s' % (
            n_total, lbl))
        if n_valid != n_total:
            print(('[util_path.remove_existing_fpaths] '
                   'trying to delete %d/%d non None %s ') %
                  (n_valid, n_total, lbl))
        print(('[util_path.remove_existing_fpaths] '
               ' %d/%d exist and need to be deleted')
              % (n_exist, n_valid))
    existing_fpath_list = ut.compress(fpath_list_, exists_list)
    return remove_fpaths(existing_fpath_list, verbose=verbose, quiet=quiet,
                            strict=strict, print_caller=False, lbl=lbl)
41330
public final void revert() {

        if (tagged) {

            // Remove the added entries
            final Iterator<K> addedIt = added.keySet().iterator();
            while (addedIt.hasNext()) {
                final K key = addedIt.next();
                map.remove(key);
                addedIt.remove();
            }

            // Replace the changed entries
            final Iterator<K> changedIt = changed.keySet().iterator();
            while (changedIt.hasNext()) {
                final K key = changedIt.next();
                final V value = changed.get(key);
                map.put(key, value);
                changedIt.remove();
            }

            // Add the removed entries
            final Iterator<K> removedIt = removed.keySet().iterator();
            while (removedIt.hasNext()) {
                final K key = removedIt.next();
                final V value = removed.get(key);
                map.put(key, value);
                removedIt.remove();
            }

        }

    }
796086
def run_on_removals(paths)
      Runner.remove(Inspector.clean(paths, :missing_ok => true), watchers, options)
    end
70784
private function addRemovePages()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $pages = $this->persist->get('pages');
        $iCur = $this->persist->get('i');
        $currentPage = &$pages[ $iCur ];
        $pagesAdd = array();
        $pagesNext = array();
        $pagesEnd = array();
        /*
        currentPage[addPages] is a list of currentPage index/keys
        step1:  determine what pageNames these correspond to
        */
        $currentAddPagesNames = array();
        foreach ($currentPage['addPages'] as $i) {
            $currentAddPagesNames[] = $pages[ $i ]['name'];
        }
        $isRevisit = !empty($currentPage['addPages']);
        foreach ($this->status['additionalPages'] as $field) {
            $pageName = $field->attribs['value'];
            $pagesAdd[] = $pageName;
            // insert default = next
            if ($isRevisit && \in_array($pageName, $currentAddPagesNames)) {
                $this->debug->warn('already inserted', $pageName);
                continue;
            }
            if ($field->insert === null || $field->insert == 'next') {
                $pagesNext[] = $pageName;
            } else {
                $pagesEnd[] = $pageName;
            }
        }
        $pagesRem = \array_diff($currentAddPagesNames, $pagesAdd);
        $this->debug->log('pagesRem', '['.\implode(', ', $pagesRem).']');
        $this->debug->log('pagesNext', '['.\implode(', ', $pagesNext).']');
        $this->debug->log('pagesEnd', '['.\implode(', ', $pagesEnd).']');
        if ($pagesRem) {
            $this->pagesRemove($pagesRem);
        }
        if ($pagesNext) {
            $this->pagesAddNext($pagesNext);
        }
        if ($pagesEnd) {
            $this->pagesAddEnd($pagesEnd);
        }
        $this->debug->groupEnd();
        return;
    }
725504
private function clean()
    {
        foreach (Finder::find($this->namespace . '*')->from($this->tempDir)->childFirst() as $entry) {
            $path = (string)$entry;
            if ($entry->isDir()) {
                //We dont use dirs, ignore
                continue;
            }

            $updateDate = $this->cache->load($entry->getFilename());
            if ($updateDate === null) {
                @unlink($path);
            }
        }

        return;
    }
181086
private List<AtlasEdge> removeUnusedEntries(AtlasVertex instanceVertex, String edgeLabel,
                                             Collection<AtlasEdge> currentEntries,
                                             Collection<AtlasEdge> newEntries,
                                             IDataType entryType, AttributeInfo attributeInfo) throws AtlasException {
        if (currentEntries != null && !currentEntries.isEmpty()) {
            LOG.debug("Removing unused entries from the old collection");
            if (entryType.getTypeCategory() == TypeCategory.STRUCT
                    || entryType.getTypeCategory() == TypeCategory.CLASS) {

                //Remove the edges for (current edges - new edges)
                List<AtlasEdge> cloneElements = new ArrayList<>(currentEntries);
                cloneElements.removeAll(newEntries);
                List<AtlasEdge> additionalElements = new ArrayList<>();

                if (LOG.isDebugEnabled()) {
                    LOG.debug("Removing unused entries from the old collection - {}", cloneElements);
                }

                if (!cloneElements.isEmpty()) {
                    for (AtlasEdge edge : cloneElements) {
                        boolean deleted = deleteHandler.deleteEdgeReference(edge, entryType.getTypeCategory(),
                                attributeInfo.isComposite, true);
                        if (!deleted) {
                            additionalElements.add(edge);
                        }
                    }
                }
                return additionalElements;
            }
        }
        return new ArrayList<>();
    }
978017
def add_blacklisted_filepaths(self, filepaths, remove_from_stored=True):
        
        self.file_manager.add_blacklisted_filepaths(filepaths,
                                                    remove_from_stored)
425616
def remove(self, path, recursive=True, skip_trash=True):
        
        if recursive:
            to_delete = []
            for s in self.get_all_data().keys():
                if s.startswith(path):
                    to_delete.append(s)
            for s in to_delete:
                self.get_all_data().pop(s)
        else:
            self.get_all_data().pop(path)
689799
def find_new(self):
        
        print("\nSearch for .new configuration files:\n")
        for path, dirs, files in os.walk(self.etc):
            del dirs    # delete unsed
            for f in files:
                if f.endswith(".new"):
                    self.news.append(os.path.join(path, f))
        if not self.news:
            print("  No new configuration files\n")
            raise SystemExit()
34645
private void cullDisabledPaths() throws Exception {

        ArrayList<EndpointOverride> removePaths = new ArrayList<EndpointOverride>();
        RequestInformation requestInfo = requestInformation.get();
        for (EndpointOverride selectedPath : requestInfo.selectedResponsePaths) {

            // check repeat count on selectedPath
            // -1 is unlimited
            if (selectedPath != null && selectedPath.getRepeatNumber() == 0) {
                // skip
                removePaths.add(selectedPath);
            } else if (selectedPath != null && selectedPath.getRepeatNumber() != -1) {
                // need to decrement the #
                selectedPath.updateRepeatNumber(selectedPath.getRepeatNumber() - 1);
            }
        }

        // remove paths if we need to
        for (EndpointOverride removePath : removePaths) {
            requestInfo.selectedResponsePaths.remove(removePath);
        }
    }
237475
def clear(self):
        """"""
        if self.prefix is not None:
            self._current_page = [self.prefix]
            self._count = len(self.prefix) + 1 # prefix + newline
        else:
            self._current_page = []
            self._count = 0
        self._pages = []
1039458
function clearCache() {
  let deletedCount = 0;

  const iter = eventSourceMappingKeysByFunctionAndStream.entries();
  let next = iter.next();
  while (!next.done) {
    const [k, key] = next.value;

    const deleted = eventSourceMappingPromisesByKey.delete(key);
    eventSourceMappingKeysByFunctionAndStream.delete(k);

    if (deleted) {
      ++deletedCount;
    }

    next = iter.next();
  }

  return deletedCount;
}
353939
def update(self, path, verbose=False):
        
        if path in self._by_path:
            self.remove(path)
        else:
            self.add(path, verbose)
756884
private List<AtlasEdge> removeUnusedArrayEntries(AtlasAttribute attribute, List<AtlasEdge> currentEntries, List<AtlasEdge> newEntries) throws AtlasBaseException {
        if (CollectionUtils.isNotEmpty(currentEntries)) {
            AtlasType entryType = ((AtlasArrayType) attribute.getAttributeType()).getElementType();

            if (AtlasGraphUtilsV1.isReference(entryType)) {
                Collection<AtlasEdge> edgesToRemove = CollectionUtils.subtract(currentEntries, newEntries);

                if (CollectionUtils.isNotEmpty(edgesToRemove)) {
                    List<AtlasEdge> additionalElements = new ArrayList<>();

                    for (AtlasEdge edge : edgesToRemove) {
                        boolean deleted = deleteHandler.deleteEdgeReference(edge, entryType.getTypeCategory(), attribute.isOwnedRef(),
                                                                             true, attribute.getRelationshipEdgeDirection());

                        if (!deleted) {
                            additionalElements.add(edge);
                        }
                    }

                    return additionalElements;
                }
            }
        }

        return Collections.emptyList();
    }
900889
public void addDeleted(CmsClientSitemapEntry entry) {

        if (m_deletions.containsKey(entry.getId())) {
            m_deletions.remove(entry.getId());
        }
        m_deletions.put(entry.getId(), entry);
        checkMapSize(m_deletions);
    }
1330216
public void deleteAll() {
        if(trackedFiles.size() == 0) {
            return;
        }

        ArrayList<File> files = new ArrayList<File>(trackedFiles);
        Collections.sort(files, filePathComparator);

        for(File file : files) {
            if(file.exists()) {
                if(!file.delete()) {
                    throw new DataUtilException("Couldn't delete a tracked "
                            + (file.isFile()? "file":"directory" + ": ") + file.getAbsolutePath());
                }
            }
        }

        trackedFiles.clear();
    }