// 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 System;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.FileProviders;
namespace Microsoft.AspNetCore.StaticFiles.Infrastructure
{
///
/// Options common to several middleware components
///
public class SharedOptions
{
private PathString _requestPath;
///
/// Defaults to all request paths.
///
public SharedOptions()
{
RequestPath = PathString.Empty;
}
///
/// The request path that maps to static resources
///
public PathString RequestPath
{
get { return _requestPath; }
set
{
if (value.HasValue && value.Value.EndsWith("/", StringComparison.Ordinal))
{
throw new ArgumentException("Request path must not end in a slash");
}
_requestPath = value;
}
}
///
/// The file system used to locate resources
///
public IFileProvider FileProvider { get; set; }
}
}