예제 #1
0
 public MediaService(
     IMediaRepository <TMedia> mediaRepository,
     IAbpStorageFactory storageFactory)
 {
     _mediaRepository = mediaRepository;
     _store           = storageFactory.GetStore(DefaultStoreName);
 }
예제 #2
0
        public AbpStoreProxy(IAbpStorageFactory factory, IOptions <TOptions> options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options),
                                                "Unable to build generic Store. Did you forget to configure your options?");
            }

            _innerStore = factory.GetStore(options.Value.Name, options.Value);
        }
예제 #3
0
        public bool TryGetStore(string storeName, out IAbpStore store, string providerName)
        {
            var configuration = _options.GetStoreConfiguration(storeName, throwIfNotFound: false);

            if (configuration != null)
            {
                var provider = GetProvider(configuration, throwIfNotFound: false);
                if (provider != null && provider.Name == providerName)
                {
                    store = provider.BuildStore(storeName);
                    return(true);
                }
            }

            store = null;
            return(false);
        }
예제 #4
0
 public static ValueTask <IFileReference[]> ListAsync(this IAbpStore store, string path, bool recursive = false,
                                                      bool withMetadata = false)
 {
     return(store.ListAsync(path, recursive, withMetadata));
 }
예제 #5
0
 public static ValueTask <IFileReference> SaveAsync(this IAbpStore store, Stream data, string path,
                                                    string contentType, OverwritePolicy overwritePolicy = OverwritePolicy.Always,
                                                    IDictionary <string, string> metadata = null)
 {
     return(store.SaveAsync(data, new PrivateFileReference(path), contentType, overwritePolicy, metadata));
 }
예제 #6
0
 public static ValueTask <string> ReadAllTextAsync(this IAbpStore store, string path)
 {
     return(store.ReadAllTextAsync(new PrivateFileReference(path)));
 }
예제 #7
0
 public static ValueTask <IFileReference> GetAsync(this IAbpStore store, string path, bool withMetadata = false)
 {
     return(store.GetAsync(new PrivateFileReference(path), withMetadata));
 }
예제 #8
0
 public static Task DeleteAsync(this IAbpStore store, string path)
 {
     return(store.DeleteAsync(new PrivateFileReference(path)));
 }
예제 #9
0
 public MediaService(IMediaRepository mediaRepository, IAbpStorageFactory storageFactory)
 {
     _mediaRepository = mediaRepository;
     _mediaStore      = storageFactory.GetStore(HitCommerceConsts.DefaultMediaStoreName);
 }
예제 #10
0
 public AbpStoreBase(string storeName, IAbpStorageFactory storageFactory)
 {
     _store = storageFactory.GetStore(storeName);
 }