Source

main / Source / WebClient / Web.DataLayer / Interfaces / IBlobDataRepository.cs

Naethra D 3ee1b94 

























































using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataUp.Web.DataLayer
{
    /// <summary>
    /// Interface representing the blob data repository methods. Also, needed for adding unit test cases.
    /// </summary>
    public interface IBlobDataRepository
    {
        /// <summary>
        /// Gets the blob content from azure as a stream.
        /// </summary>
        /// <param name="blobName">
        /// Name of the blob.
        /// </param>
        /// <returns>
        /// The blob details.
        /// </returns>
        BlobDetails GetBlobContent(string blobName);

        /// <summary>
        /// Uploads a file to azure as a blob.
        /// </summary>
        /// <param name="details">
        /// Details of the file which has to be uploaded to azure.
        /// </param>
        /// <returns>
        /// True if the file is uploaded successfully; otherwise false.
        /// </returns>
        bool UploadFile(BlobDetails details);

        /// <summary>
        /// Deletes a file from azure.
        /// </summary>
        /// <param name="details">
        /// Details of the file which has to be uploaded to azure.
        /// </param>
        /// <returns>
        /// True if the file is deleted successfully; otherwise false.
        /// </returns>
        bool DeleteFile(BlobDetails details);

        /// <summary>
        /// Checks a file in azure.
        /// </summary>
        /// <param name="details">
        /// Details of the file which has to be checked.
        /// </param>
        /// <returns>
        /// True if the file is found successfully; otherwise false.
        /// </returns>
        bool CheckIfExists(BlobDetails details);
    }
}