Ejemplo n.º 1
0
        public Task <IStoreCollection> GetCollectionAsync(Uri uri, IHttpContext httpContext)
        {
            LogInfo(Strings.WebDavProcessingCollectionRequestFormat, uri, httpContext.Request.HttpMethod);
            var path = uri.LocalPath;
            var name = Path.GetFileName(path);

            if (IsIgnoredFile(name))
            {
                return(Task.FromResult((IStoreCollection)null));
            }
            return(Task.Run(() =>
            {
                try
                {
                    var stat = EfsFileManager.Instance.GetEntry(_manager, path);
                    if (stat.Mode == 0)
                    {
                        LogWarning(Strings.WebDavWarningPathNotFoundFormat, path);
                        return null;
                    }

                    var item = EfsStoreCollection.Create(_manager, name, path, path, _readOnly, _logger, _logLevel);
                    return (IStoreCollection)item;
                }
                catch (Exception ex)
                {
                    LogError(Strings.WebDavErrorGetReadableStreamFormat, path, ex.Message);
                    return null;
                }
            }));
        }
Ejemplo n.º 2
0
        public static EfsStoreCollection Create(QcdmManager manager, string name, string uniqueKey, string path,
                                                bool isReadOnly, Logger logger, LogLevel logLevel)
        {
            var item = new EfsStoreCollection(manager, name, uniqueKey, path, isReadOnly, logger, logLevel);

            item.Initialize();
            return(item);
        }