serveResult method

ServingResult? serveResult(
  1. String path
)

this will return either a file or a directory or null if there were no file nor a folder the path must be at the formula /(folder_alias)/(request_file.extension) or any other format that starts with the folder_alias then the path of the file or the sub folder

Implementation

ServingResult? serveResult(String path) {
  StorageEntity? entity = _getEntityPath(path);
  if (entity == null) {
    return null;
  }
  if (entity.type == StorageEntityType.folder) {
    return FolderResult(
      entity.path,
      allowSendPath: _allowViewingEntityPath,
      parentAlias: entity.parentAlias,
    );
  } else if (entity.type == StorageEntityType.file) {
    return FileResult(
      entity.path,
      parentAlias: entity.parentAlias,
    );
  }
  return null;
}