/// <summary> /// Initializes new instance of this class based on the WebDAV Engine configuration options and logger instance. /// </summary> /// <param name="configOptions">WebDAV Engine configuration options.</param> /// <param name="logger">Logger instance.</param> /// <param name="env">IHostingEnvironment instance.</param> public GSuiteEngineCore(IOptions <DavEngineOptions> engineOptions, IOptions <GSuiteOptions> gDriveOptions, ILogger logger) : base(gDriveOptions.Value.ClientEmail, gDriveOptions.Value.PrivateKey) { DavEngineOptions options = engineOptions.Value; OutputXmlFormatting = options.OutputXmlFormatting; CorsAllowedFor = options.CorsAllowedFor; License = options.License; Logger = logger; }
/// <summary> /// Initializes new instance of this class based on the WebDAV Engine configuration options and logger instance. /// </summary> /// <param name="configOptions">WebDAV Engine configuration options.</param> /// <param name="logger">Logger instance.</param> /// <param name="env">IHostingEnvironment instance.</param> public DavEngineCore(IOptions <DavEngineOptions> configOptions, ILogger logger, IHostingEnvironment env) : base() { DavEngineOptions options = configOptions.Value; OutputXmlFormatting = options.OutputXmlFormatting; UseFullUris = options.UseFullUris; CorsAllowedFor = options.CorsAllowedFor; License = options.License; Logger = logger; // Set custom handler to process GET and HEAD requests to folders and display // info about how to connect to server. We are using the same custom handler // class (but different instances) here to process both GET and HEAD because // these requests are very similar. // Note that some WebDAV clients may fail to connect if HEAD request is not processed. MyCustomGetHandler handlerGet = new MyCustomGetHandler(env.ContentRootPath); MyCustomGetHandler handlerHead = new MyCustomGetHandler(env.ContentRootPath); handlerGet.OriginalHandler = RegisterMethodHandler("GET", handlerGet); handlerHead.OriginalHandler = RegisterMethodHandler("HEAD", handlerHead); }