getFileInfo method

  1. @override
FileInfo getFileInfo(
  1. String subpath
)
override

Locate a file at the given path.

Implementation

@override
FileInfo getFileInfo(String subpath) {
  var path = subpath.trim();

  // Remove leading separator if present
  if (path.startsWith(p.separator)) {
    path = path.substring(p.separator.length);
  }

  if (p.isRootRelative(path)) {
    return NotFoundFileInfo(path);
  }

  final fullPath = _getFullPath(path);
  if (fullPath == null) {
    return NotFoundFileInfo(path);
  }

  var fileInfo = const LocalFileSystem().file(fullPath);

  return PhysicalFileInfo(fileInfo);
}