// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.StaticFiles.Infrastructure;
namespace Microsoft.AspNetCore.Builder
{
///
/// Options for all of the static file middleware components
///
public class FileServerOptions : SharedOptionsBase
{
///
/// Creates a combined options class for all of the static file middleware components.
///
public FileServerOptions()
: base(new SharedOptions())
{
StaticFileOptions = new StaticFileOptions(SharedOptions);
DirectoryBrowserOptions = new DirectoryBrowserOptions(SharedOptions);
DefaultFilesOptions = new DefaultFilesOptions(SharedOptions);
EnableDefaultFiles = true;
}
///
/// Options for configuring the StaticFileMiddleware.
///
public StaticFileOptions StaticFileOptions { get; private set; }
///
/// Options for configuring the DirectoryBrowserMiddleware.
///
public DirectoryBrowserOptions DirectoryBrowserOptions { get; private set; }
///
/// Options for configuring the DefaultFilesMiddleware.
///
public DefaultFilesOptions DefaultFilesOptions { get; private set; }
///
/// Directory browsing is disabled by default.
///
public bool EnableDirectoryBrowsing { get; set; }
///
/// Default files are enabled by default.
///
public bool EnableDefaultFiles { get; set; }
}
}