src/main/java/wyfs/util/DirectoryRoot.java
public <T> List<Path.Entry<T>> find(List<File> files,
			Content.Type<T> contentType)
			throws IOException {
		ArrayList<Path.Entry<T>> sources = new ArrayList<>();
		String suffix = "." + contentTypes.suffix(contentType);
		String location = location().getCanonicalPath();

		for (File file : files) {
			String filePath = file.getCanonicalPath();
			if (filePath.startsWith(location)) {
				int end = location.length();
				if (end > 1) {
					end++;
				}
				String module = filePath.substring(end).replace(
						File.separatorChar, '/');
				if (module.endsWith(suffix)) {
					module = module.substring(0,
							module.length() - suffix.length());
					Path.ID mid = Trie.fromString(module);
					Path.Entry<T> entry = this.get(mid, contentType);
					if (entry != null) {
						sources.add(entry);
						continue;
					}
				}
			}
		}

		return sources;
	}
public <T> List<Path.Entry<T>> find(List<File> files,
			Content.Type<T> contentType)
			throws IOException {
		ArrayList<Path.Entry<T>> sources = new ArrayList<>();
		String suffix = "." + contentTypes.suffix(contentType);
		String location = location().getCanonicalPath();

		for (File file : files) {
			String filePath = file.getCanonicalPath();
			if (filePath.startsWith(location)) {
				int end = location.length();
				if (end > 1) {
					end++;
				}
				String module = filePath.substring(end).replace(
						File.separatorChar, '/');
				if (module.endsWith(suffix)) {
					module = module.substring(0,
							module.length() - suffix.length());
					Path.ID mid = Trie.fromString(module);
					Path.Entry<T> entry = this.get(mid, contentType);
					if (entry != null) {
						sources.add(entry);
						continue;
					}
				}
			}
		}

		return sources;
	}
public < T > List < Path . Entry < T > > find ( List < File > files , Content . Type < T > contentType ) throws IOException { ArrayList < Path . Entry < T >> sources = new ArrayList <> ( ) ; String suffix = "." + contentTypes . suffix ( contentType ) ; String location = location ( ) . getCanonicalPath ( ) ; for ( File file : files ) { String filePath = file . getCanonicalPath ( ) ; if ( filePath . startsWith ( location ) ) { int end = location . length ( ) ; if ( end > 1 ) { end ++ ; } String module = filePath . substring ( end ) . replace ( File . separatorChar , ' ' ) ; if ( module . endsWith ( suffix ) ) { module = module . substring ( 0 , module . length ( ) - suffix . length ( ) ) ; Path . ID mid = Trie . fromString ( module ) ; Path . Entry < T > entry = this . get ( mid , contentType ) ; if ( entry != null ) { sources . add ( entry ) ; continue ; } } } } return sources ; }
Given a list of physical files on the file system, determine their
corresponding <code>Path.Entry</code> instances in this root (if there
are any).

@param files
--- list of files on the physical file system.
@param contentType
--- content type of files to match.
@return --- list of path entries where each entry matches the
corresponding entry in files, or is null (if there is no match).
@throws IOException
Given a list of physical files on the file system determine their corresponding <code > Path . Entry< / code > instances in this root ( if there are any ) .