serveStat method
Writes the file at the path given by the stat
to a response.
Implementation
Future<bool> serveStat(String absolute, String relative, FileStat stat,
RequestContext req, ResponseContext res) async {
if (stat.type == FileSystemEntityType.directory) {
return await serveDirectory(
fileSystem.directory(absolute), relative, stat, req, res);
} else if (stat.type == FileSystemEntityType.file) {
return await serveFile(fileSystem.file(absolute), stat, req, res);
} else if (stat.type == FileSystemEntityType.link) {
var link = fileSystem.link(absolute);
return await servePath(await link.resolveSymbolicLinks(), req, res);
} else {
return true;
}
}