mirror of https://github.com/abpframework/abp.git
6 changed files with 157 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,21 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.BlobStoring</AssemblyName> |
|||
<PackageId>Volo.Abp.BlobStoring</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.BlobStoring |
|||
{ |
|||
public class AbpBlobStoringModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
using System.IO; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.BlobStoring |
|||
{ |
|||
public interface IBlobContainer |
|||
{ |
|||
/// <summary>
|
|||
/// Saves a blob <see cref="Stream"/> to the container.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the blob</param>
|
|||
/// <param name="stream">A stream for the blob</param>
|
|||
/// <param name="overrideExisting">
|
|||
/// Set <code>true</code> to override if there is already a blob in the container with the given name.
|
|||
/// If set to <code>false</code> (default), throws exception if there is already a blob in the container with the given name.
|
|||
/// </param>
|
|||
/// <param name="cancellationToken">Cancellation token</param>
|
|||
Task SaveAsync( |
|||
string name, |
|||
Stream stream, |
|||
bool overrideExisting = false, |
|||
CancellationToken cancellationToken = default |
|||
); |
|||
|
|||
/// <summary>
|
|||
/// Deletes a blob from the container.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the blob</param>
|
|||
/// <param name="cancellationToken">Cancellation token</param>
|
|||
/// <returns>
|
|||
/// Returns true if actually deleted the blob.
|
|||
/// Returns false if the blob with the given <paramref name="name"/> was not exists.
|
|||
/// </returns>
|
|||
Task<bool> DeleteAsync( |
|||
string name, |
|||
CancellationToken cancellationToken = default |
|||
); |
|||
|
|||
/// <summary>
|
|||
/// Checks if a blob does exists in the container.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the blob</param>
|
|||
/// <param name="cancellationToken">Cancellation token</param>
|
|||
Task<bool> ExistsAsync( |
|||
string name, |
|||
CancellationToken cancellationToken = default |
|||
); |
|||
|
|||
/// <summary>
|
|||
/// Gets a blob from the container.
|
|||
/// It actually gets a <see cref="Stream"/> to read the blob data.
|
|||
/// It throws exception if there is no blob with the given <paramref name="name"/>.
|
|||
/// Use <see cref="GetOrNullAsync"/> if you want to get <code>null</code> if there is no blob with the given <paramref name="name"/>.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the blob</param>
|
|||
/// <param name="cancellationToken">Cancellation token</param>
|
|||
/// <returns>
|
|||
/// A <see cref="Stream"/> to read the blob data.
|
|||
/// </returns>
|
|||
Task<Stream> GetAsync( |
|||
string name, |
|||
CancellationToken cancellationToken = default |
|||
); |
|||
|
|||
/// <summary>
|
|||
/// Gets a blob from the container, or returns null if there is no blob with the given <paramref name="name"/>.
|
|||
/// It actually gets a <see cref="Stream"/> to read the blob data.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the blob</param>
|
|||
/// <param name="cancellationToken">Cancellation token</param>
|
|||
/// <returns>
|
|||
/// A <see cref="Stream"/> to read the blob data.
|
|||
/// </returns>
|
|||
Task<Stream> GetOrNullAsync( |
|||
string name, |
|||
CancellationToken cancellationToken = default |
|||
); |
|||
|
|||
//TODO: Create shortcut extension methods: GetAsArraryAsync, GetAsStringAsync(encoding) (and null versions)
|
|||
} |
|||
|
|||
public interface IBlobContainerManager |
|||
{ |
|||
//Get (or create), Delete (if does exists)
|
|||
} |
|||
} |
|||
Loading…
Reference in new issue