private static void addPathToDigest(File path, String suffix, MessageDigest digest, boolean recursive, boolean fullPathNames) throws IOException {
        if (!path.exists()) return;
        if (fullPathNames) {
            digest.update(path.getPath().getBytes(Utf8.getCharset()));
        } else {
            digest.update(path.getName().getBytes(Utf8.getCharset()));
        }
        if (path.isFile()) {
            FileInputStream is = new FileInputStream(path);
            addToDigest(is, digest);
            is.close();
        } else if (path.isDirectory()) {
            final File[] files = path.listFiles();
            if (files != null) {
                for (File elem : files) {
                    if ((elem.isDirectory() && recursive) || elem.getName().endsWith(suffix)) {
                        addPathToDigest(elem, suffix, digest, recursive, fullPathNames);
                    }
                }
            }
        }
    }
Adds the given path to the digest, or does nothing if path is neither file nor dir

@param path path to add to message digest
@param suffix only files with this suffix are considered
@param digest the {link @MessageDigest} to add the file paths to
@param recursive whether to recursively find children in the paths
@param fullPathNames whether to include the full paths in checksum or only the names
@throws java.io.IOException if adding path to digest fails when reading files from path
config-application-package/src/main/java/com/yahoo/config/model/application/provider/FilesApplicationPackage.java