Registers a new feature directory's new checksum

@param featureDir the feature directory
@param fileName the filename for the checksum
@param checksum the checksum as a String
510486
public void registerNewChecksums(File featureDir, String fileName, String checksum) {
        ChecksumData checksums = checksumsMap.get(featureDir);
        if (checksums == null) {
            checksums = new ChecksumData();
            checksumsMap.put(featureDir, checksums);
        }
        checksums.registerNewChecksums(fileName, checksum);
    }
1211925
public void syncFilename(String fileName) {
    if (emitLineDirectives) {
      if (!fileName.equals(currentFile)) {
        currentLine = BEGINNING_OF_FILE;
        // C11 spec. (6.10.4) requires a line number between 1 and 2147483647.
        buffer.append(UnicodeUtils.format("\n#line 1 \"%s\"\n", fileName));
      }
    }
    currentFile = fileName;
  }
1285143
public void addInclude(String include) {

        include = normalizePath(include);
        m_includes.add(include);
        m_allPaths.add(include);
    }
389575
public synchronized void addFile(String filename, String filePath) {
        // fix this to check if duplicate name exists.
        int fileIndex = fileNameList.indexOf(filename);
        if (fileIndex == -1) {
            fileNameList.add(filename);
            filePathList.add(filePath);
        }
    }
889280
public Map<String, ProvisioningFeatureDefinition> getCoreFeatureDefinitionsExceptPlatform() {
        Map<String, ProvisioningFeatureDefinition> features = new TreeMap<String, ProvisioningFeatureDefinition>();
        File featureDir = getCoreFeatureDir();
        //the feature directory may not exist if the packaged server had no features installed when minified
        if (!featureDir.isDirectory() && !featureDir.mkdir()) {
            throw new FeatureToolException("Unable to find or create feature directory: " + featureDir,
                                           MessageFormat.format(NLS.messages.getString("tool.feature.dir.not.found"), featureDir),
                                           null,
                                           ReturnCode.MISSING_CONTENT);
        }

        File[] manifestFiles = featureDir.listFiles(MFFilter);
        if (manifestFiles != null) {
            for (File file : manifestFiles) {
                try {
                    ProvisioningFeatureDefinition fd = new SubsystemFeatureDefinitionImpl(ExtensionConstants.CORE_EXTENSION, file);
                    if (fd.isSupportedFeatureVersion()) {
                        // using symbolic name because gets compared to FeatureResource symbolic name
                        features.put(fd.getSymbolicName(), fd);
                    }
                } catch (IOException e) {
                    // TODO: PROPER NLS MESSAGE
                    throw new FeatureToolException("Unable to read core feature manifest: " + file,
                                                   (String) null,
                                                   e,
                                                   ReturnCode.BAD_FEATURE_DEFINITION);
                }
            }
        }
        return features;
    }
810464
public void addClassesToCheck(File basedir, Iterable<String> relativeNames) throws IOException {
    logger.info("Loading classes to check...");
    for (final String f : relativeNames) {
      addClassToCheck(new File(basedir, f));
    }
  }
1124724
public File getCoreFeatureDir() {
        File featureDir = null;
        File installDir = Utils.getInstallDir();

        if (installDir != null) {
            featureDir = new File(installDir, FEATURE_DIR);
        }

        if (featureDir == null) {
            throw new RuntimeException("Feature Directory not found");
        }

        return featureDir;
    }
545554
private void checkIncludePatterns() {
        Map newroots = new HashMap();
        // put in the newroots map the include patterns without
        // wildcard tokens
        for (int i = 0; i < includes.length; i++) {
            if (FileUtil.isAbsolutePath(includes[i])) {
                //skip abs. paths not under basedir, if set:
                if (basedir != null
                    && !SelectorUtils.matchPatternStart(includes[i],
                    basedir.getAbsolutePath(), isCaseSensitive())) {
                    continue;
                }
            } else if (basedir == null) {
                //skip non-abs. paths if basedir == null:
                continue;
            }
            newroots.put(SelectorUtils.rtrimWildcardTokens(
                includes[i]), includes[i]);
        }
        if (newroots.containsKey("") && basedir != null) {
            // we are going to scan everything anyway
            scandir(basedir, "", true);
        } else {
            // only scan directories that can include matched files or
            // directories
            Iterator it = newroots.entrySet().iterator();

            File canonBase = null;
            if (basedir != null) {
                try {
                    canonBase = basedir.getCanonicalFile();
                } catch (IOException ex) {
                    throw new RuntimeException(ex);
                }
            }
            while (it.hasNext()) {
                Map.Entry entry = (Map.Entry) it.next();
                String currentelement = (String) entry.getKey();

                if (basedir == null && !FileUtil.isAbsolutePath(currentelement)) {
                    continue;
                }
                String originalpattern = (String) entry.getValue();
                File myfile = new File(basedir, currentelement);

                if (myfile.exists()) {
                    // may be on a case insensitive file system.  We want
                    // the results to show what's really on the disk, so
                    // we need to double check.
                    try {
                        String path = (basedir == null)
                            ? myfile.getCanonicalPath()
                            : FileUtil.removeLeadingPath(canonBase,
                            myfile.getCanonicalFile());
                        if (!path.equals(currentelement)) {
                            myfile = findFile(basedir, currentelement, true);
                            if (myfile != null && basedir != null) {
                                currentelement = FileUtil.removeLeadingPath(
                                    basedir, myfile);
                            }
                        }
                    } catch (IOException ex) {
                        throw new RuntimeException(ex);
                    }
                }
                if ((myfile == null || !myfile.exists()) && !isCaseSensitive()) {
                    File f = findFile(basedir, currentelement, false);
                    if (f != null && f.exists()) {
                        // adapt currentelement to the case we've
                        // actually found
                        currentelement = (basedir == null)
                            ? f.getAbsolutePath()
                            : FileUtil.removeLeadingPath(basedir, f);
                        myfile = f;
                    }
                }
                if (myfile != null && myfile.exists()) {
                    if (!followSymlinks
                        && isSymlink(basedir, currentelement)) {
                        continue;
                    }
                    if (myfile.isDirectory()) {
                        if (isIncluded(currentelement)
                            && currentelement.length() > 0) {
                            accountForIncludedDir(currentelement, myfile, true);
                        }  else {
                            if (currentelement.length() > 0) {
                                if (currentelement.charAt(currentelement
                                                          .length() - 1)
                                    != File.separatorChar) {
                                    currentelement =
                                        currentelement + File.separatorChar;
                                }
                            }
                            scandir(myfile, currentelement, true);
                        }
                    } else {
                        boolean included = isCaseSensitive()
                            ? originalpattern.equals(currentelement)
                            : originalpattern.equalsIgnoreCase(currentelement);
                        if (included) {
                            accountForIncludedFile(currentelement, myfile);
                        }
                    }
                }
            }
        }
    }
1260990
void register(String repoFullName) {
    lock.writeLock().lock();
    try {
      if (!entityListenersByRepo.containsKey(requireNonNull(repoFullName))) {
        entityListenersByRepo.put(repoFullName, HashMultimap.create());
      }
    } finally {
      lock.writeLock().unlock();
    }
  }
1062874
boolean add(Path filename) {
    synchronized (pendingReplications) {
      PendingInfo found = pendingReplications.get(filename);
      if (found == null) {
        pendingReplications.put(filename, new PendingInfo(filename));
        return true;
      }
      return false;
    }
  }
1118356
public void registerInclude(String programName, RecursiveTypeRegistry registry) {
        if (registry == this) {
            throw new IllegalArgumentException("Registering include back to itself: " + programName);
        }
        if (includes.containsKey(programName)) {
            return;
        }
        includes.put(programName, registry);
    }
755037
function verifyChecksum(fileName, checksum) {
  return kew.resolve(hasha.fromFile(fileName, {algorithm: 'sha256'})).then(function (hash) {
    var result = checksum == hash
    if (result) {
      console.log('Verified checksum of previously downloaded file')
    } else {
      console.log('Checksum did not match')
    }
    return result
  }).fail(function (err) {
    console.error('Failed to verify checksum: ', err)
    return false
  })
}
157770
public static File[] listFiles(final File target, final List<Pattern> patterns, final boolean include) {
        if (patterns == null || patterns.isEmpty())
            return target.listFiles();

        return target.listFiles(new FilenameFilter() {

            @Override
            public boolean accept(File dir, String name) {
                for (Pattern pattern : patterns) {
                    Matcher matcher = pattern.matcher(name);
                    if (matcher.matches())
                        return include;
                }
                return !include;
            }

        });

    }
1258601
private void registerMismatch(JSType found, JSType required, JSError error) {
    TypeMismatch.registerMismatch(
        this.mismatches, this.implicitInterfaceUses, found, required, error);
  }
1374741
def check_filename(filename)
      extension = filename.split('.').last
      return true if valid_extensions.include?(extension)
      false
    end
976065
public void registerCachedFile(String name, DistributedCacheEntry entry) throws IOException {
		if (!this.cacheFile.containsKey(name)) {
			this.cacheFile.put(name, entry);
		} else {
			throw new IOException("cache file " + name + "already exists!");
		}
	}
582333
def include_feature(self, name):
        """'"""

        if self.feature_is_included(name) == 0:
            descr = self.features[name].description
            raise DistutilsOptionError(
                descr + " is required, but was excluded or is not available"
            )
        self.features[name].include_in(self)
        self._set_feature(name, 1)