toLink method

Future<Link> toLink()

Implementation

Future<Link> toLink() async {
  Link link = Link(
      id: path.addPrefix("/"),
      href: path.addPrefix("/"),
      type: (await MediaType.ofSingleHint(fileExtension: path.extension()))
          ?.toString());

  if (compressedLength != null) {
    link = link.addProperties({"compressedLength": compressedLength});
  }

  return link;
}