Ejemplo n.º 1
0
 /// <summary>
 ///   Opens an existing IPFS file for reading.
 /// </summary>
 /// <param name="path">
 ///   A path to an existing file, such as "QmXarR6rgkQ2fDSHjSY5nM2kuCXKYGViky5nohtwgF65Ec/about"
 ///   or "QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V"
 /// </param>
 /// <param name="cancel">
 ///   Is used to stop the task.  When cancelled, the <see cref="TaskCanceledException"/> is raised.
 /// </param>
 /// <returns>
 ///   A <see cref="Stream"/> to the file contents.
 /// </returns>
 public Task <Stream> ReadFileAsync(string path, CancellationToken cancel = default(CancellationToken))
 {
     return(ipfs.DownloadAsync("cat", cancel, path));
 }
Ejemplo n.º 2
0
 /// <summary>
 ///   Get the data of a MerkleDAG node.
 /// </summary>
 /// <param name="hash">
 ///   The <see cref="string"/> representation of an encoded <see cref="Ipfs.MultiHash"/>.
 /// </param>
 /// <param name="cancel">
 ///   Is used to stop the task.  When cancelled, the <see cref="TaskCanceledException"/> is raised.
 /// </param>
 /// <returns></returns>
 /// <remarks>
 ///   The caller must dispose the returned <see cref="Stream"/>.
 /// </remarks>
 public Task <Stream> DataAsync(string hash, CancellationToken cancel = default(CancellationToken))
 {
     return(ipfs.DownloadAsync("object/data", cancel, hash));
 }
Ejemplo n.º 3
0
 public Task <Stream> DataAsync(Cid id, CancellationToken cancel = default(CancellationToken))
 {
     return(ipfs.DownloadAsync("object/data", cancel, id));
 }
Ejemplo n.º 4
0
 /// <summary>
 ///   Get the data of a MerkleDAG node.
 /// </summary>
 /// <param name="hash">
 ///   The <see cref="string"/> representation of an encoded <see cref="Ipfs.MultiHash"/>.
 /// </param>
 /// <returns></returns>
 /// <remarks>
 ///   The caller must dispose the returned <see cref="Stream"/>.
 /// </remarks>
 public Task <Stream> DataAsync(string hash)
 {
     return(ipfs.DownloadAsync("object/data", hash));
 }
Ejemplo n.º 5
0
 /// <summary>
 ///   Opens an existing IPFS file for reading.
 /// </summary>
 /// <param name="path">
 ///   A path to an existing file, such as "QmXarR6rgkQ2fDSHjSY5nM2kuCXKYGViky5nohtwgF65Ec/about"
 ///   or "QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V"
 /// </param>
 /// <returns>
 ///   A <see cref="Stream"/> to the file contents.
 /// </returns>
 public Task <Stream> ReadFileAsync(string path)
 {
     return(ipfs.DownloadAsync("cat", path));
 }