├── .dockerignore
├── .editorconfig
├── .gitattributes
├── .github
└── FUNDING.yml
├── .gitignore
├── DotNetSdkMono.props
├── FubarDev.FtpServer.ruleset
├── FubarDev.FtpServer.sln
├── FubarDev.FtpServer.sln.DotSettings
├── FubarDev.FtpServer.v3.ncrunchsolution
├── GitVersion.yml
├── Global.props
├── GlobalAssemblyInfo.cs
├── LICENSE.md
├── PackageLibrary.props
├── README.md
├── azure-pipelines.yml
├── docfx_project
├── .gitignore
├── api
│ ├── .gitignore
│ └── index.md
├── articles
│ ├── authentication.md
│ ├── configuration.md
│ ├── custom-authentication.md
│ ├── custom-file-system.md
│ ├── file-systems.md
│ ├── ftps.md
│ ├── google-drive.md
│ ├── intro.md
│ ├── logging.md
│ ├── project-structure.md
│ ├── quickstart-aspnetcore-host.md
│ ├── quickstart-generic-host.md
│ ├── quickstart.md
│ ├── toc.yml
│ └── upgrade-3.0.md
├── code-snippets
│ ├── logging-nlog
│ │ ├── Program.cs
│ │ ├── QuickStart.csproj
│ │ └── nlog.config
│ ├── logging-serilog
│ │ ├── Program.cs
│ │ └── QuickStart.csproj
│ ├── quickstart-2.x
│ │ ├── Program.cs
│ │ └── QuickStart.csproj
│ ├── quickstart-aspnetcore-host
│ │ ├── HostedFtpService.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── Startup.cs
│ │ ├── TestAspNetCoreHost.csproj
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
│ ├── quickstart-generic-host
│ │ ├── HostedFtpService.cs
│ │ ├── Program.cs
│ │ └── TestGenericHost.csproj
│ └── quickstart
│ │ ├── Program.cs
│ │ └── QuickStart.csproj
├── docfx.json
├── index.md
└── toc.yml
├── docs
├── api
│ ├── FubarDev.FtpServer.AccountManagement.Anonymous.BlockAnonymousValidation.html
│ ├── FubarDev.FtpServer.AccountManagement.Anonymous.IAnonymousPasswordValidator.html
│ ├── FubarDev.FtpServer.AccountManagement.Anonymous.NoTopLevelDomainValidation.html
│ ├── FubarDev.FtpServer.AccountManagement.Anonymous.NoValidation.html
│ ├── FubarDev.FtpServer.AccountManagement.Anonymous.SimpleMailAddressValidation.html
│ ├── FubarDev.FtpServer.AccountManagement.Anonymous.html
│ ├── FubarDev.FtpServer.AccountManagement.AnonymousFtpUser.html
│ ├── FubarDev.FtpServer.AccountManagement.AnonymousMembershipProvider.html
│ ├── FubarDev.FtpServer.AccountManagement.Compatibility.AnonymousClaimsFtpUser.html
│ ├── FubarDev.FtpServer.AccountManagement.Compatibility.ClaimsFtpUser.html
│ ├── FubarDev.FtpServer.AccountManagement.Compatibility.ClaimsPrincipalExtensions.html
│ ├── FubarDev.FtpServer.AccountManagement.Compatibility.FtpUserExtensions.html
│ ├── FubarDev.FtpServer.AccountManagement.Compatibility.UnixClaimsFtpUser.html
│ ├── FubarDev.FtpServer.AccountManagement.Compatibility.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.GenericAccountDirectories.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.RootPerUser.RootPerUserAccountDirectoryQuery.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.RootPerUser.RootPerUserAccountDirectoryQueryOptions.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.RootPerUser.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.SingleRootWithoutHome.SingleRootWithoutHomeAccountDirectoryQuery.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.SingleRootWithoutHome.SingleRootWithoutHomeAccountDirectoryQueryOptions.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.SingleRootWithoutHome.html
│ ├── FubarDev.FtpServer.AccountManagement.Directories.html
│ ├── FubarDev.FtpServer.AccountManagement.FtpClaimTypes.html
│ ├── FubarDev.FtpServer.AccountManagement.IAnonymousFtpUser.html
│ ├── FubarDev.FtpServer.AccountManagement.IFtpUser.html
│ ├── FubarDev.FtpServer.AccountManagement.IMembershipProvider.html
│ ├── FubarDev.FtpServer.AccountManagement.IUnixUser.html
│ ├── FubarDev.FtpServer.AccountManagement.MemberValidationResult.html
│ ├── FubarDev.FtpServer.AccountManagement.MemberValidationStatus.html
│ ├── FubarDev.FtpServer.AccountManagement.html
│ ├── FubarDev.FtpServer.Address.html
│ ├── FubarDev.FtpServer.AuthTlsOptions.html
│ ├── FubarDev.FtpServer.Authentication.AuthenticationMechanism.html
│ ├── FubarDev.FtpServer.Authentication.DefaultSslStreamWrapperFactory.html
│ ├── FubarDev.FtpServer.Authentication.IAuthenticationMechanism.html
│ ├── FubarDev.FtpServer.Authentication.ISslStreamWrapperFactory.html
│ ├── FubarDev.FtpServer.Authentication.TlsAuthenticationMechanism.html
│ ├── FubarDev.FtpServer.Authentication.html
│ ├── FubarDev.FtpServer.Authorization.Actions.FillConnectionAccountDataAction.html
│ ├── FubarDev.FtpServer.Authorization.Actions.FillConnectionFileSystemDataAction.html
│ ├── FubarDev.FtpServer.Authorization.Actions.SetHomeDirectoryAction.html
│ ├── FubarDev.FtpServer.Authorization.Actions.SetHomeDirectoryActionOptions.html
│ ├── FubarDev.FtpServer.Authorization.Actions.html
│ ├── FubarDev.FtpServer.Authorization.AuthorizationMechanism.html
│ ├── FubarDev.FtpServer.Authorization.IAuthorizationAction.html
│ ├── FubarDev.FtpServer.Authorization.IAuthorizationMechanism.html
│ ├── FubarDev.FtpServer.Authorization.PasswordAuthorization.html
│ ├── FubarDev.FtpServer.Authorization.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.BackgroundCommandHandler.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.BackgroundTransferInfo.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.BackgroundTransferStatus.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.IBackgroundTransfer.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.IBackgroundTransferWorker.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.ITemporaryData.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.ITemporaryDataFactory.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.TempFileTemporaryData.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.TemporaryDataFactory.CreateAsyncDelegate.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.TemporaryDataFactory.html
│ ├── FubarDev.FtpServer.BackgroundTransfer.html
│ ├── FubarDev.FtpServer.ClaimsIdentityExtensions.html
│ ├── FubarDev.FtpServer.ClaimsPrincipalExtensions.html
│ ├── FubarDev.FtpServer.CloseEncryptedStreamDelegate.html
│ ├── FubarDev.FtpServer.CommandExtensions.AssemblyFtpCommandHandlerExtensionScanner.html
│ ├── FubarDev.FtpServer.CommandExtensions.DefaultFtpCommandHandlerExtensionProvider.html
│ ├── FubarDev.FtpServer.CommandExtensions.FtpCommandHandlerExtension.html
│ ├── FubarDev.FtpServer.CommandExtensions.FtpCommandHandlerExtensionAttribute.html
│ ├── FubarDev.FtpServer.CommandExtensions.GenericFtpCommandHandlerExtension.html
│ ├── FubarDev.FtpServer.CommandExtensions.IFtpCommandHandlerExtensionInformation.html
│ ├── FubarDev.FtpServer.CommandExtensions.IFtpCommandHandlerExtensionInstanceInformation.html
│ ├── FubarDev.FtpServer.CommandExtensions.IFtpCommandHandlerExtensionProvider.html
│ ├── FubarDev.FtpServer.CommandExtensions.IFtpCommandHandlerExtensionScanner.html
│ ├── FubarDev.FtpServer.CommandExtensions.OptsMlstCommandExtension.html
│ ├── FubarDev.FtpServer.CommandExtensions.OptsUtf8CommandExtension.html
│ ├── FubarDev.FtpServer.CommandExtensions.ServiceFtpCommandHandlerExtensionScanner.html
│ ├── FubarDev.FtpServer.CommandExtensions.SiteBlstCommandExtension.html
│ ├── FubarDev.FtpServer.CommandExtensions.SiteUtimeCommandExtension.html
│ ├── FubarDev.FtpServer.CommandExtensions.html
│ ├── FubarDev.FtpServer.CommandHandlers.AborCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.AcctCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.AdatCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.AlloCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.AppeCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.AuthCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.AuthTlsCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.CdUpCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.CwdCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.DeleCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.FeatCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.FtpCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.HelpCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.HostCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.IFtpCommandHandlerExtensionHost.html
│ ├── FubarDev.FtpServer.CommandHandlers.LangCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.ListCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.MdtmCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.MfctCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.MffCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.MfmtCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.MkdCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.MlstCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.ModeCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.NoOpCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.OptsCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.PassCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.PasvCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.PbszCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.PortCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.ProtCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.PwdCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.QuitCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.ReinCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.RestCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.RetrCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.RmdCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.RnfrCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.RntoCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.SiteCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.SizeCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.StatCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.StorCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.StruCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.SystCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.TypeCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.UserCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.XcwdCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.XmkdCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.XrmdCommandHandler.html
│ ├── FubarDev.FtpServer.CommandHandlers.html
│ ├── FubarDev.FtpServer.Commands.AssemblyFtpCommandHandlerScanner.html
│ ├── FubarDev.FtpServer.Commands.DefaultFeatureInfoProvider.html
│ ├── FubarDev.FtpServer.Commands.DefaultFtpCommandActivator.html
│ ├── FubarDev.FtpServer.Commands.DefaultFtpCommandDispatcher.html
│ ├── FubarDev.FtpServer.Commands.DefaultFtpCommandHandlerProvider.html
│ ├── FubarDev.FtpServer.Commands.FoundFeatureInfo.html
│ ├── FubarDev.FtpServer.Commands.FtpCommandContext.html
│ ├── FubarDev.FtpServer.Commands.FtpCommandExecutionDelegate.html
│ ├── FubarDev.FtpServer.Commands.FtpCommandHandlerAttribute.html
│ ├── FubarDev.FtpServer.Commands.FtpCommandSelection.html
│ ├── FubarDev.FtpServer.Commands.FtpExecutionContext.html
│ ├── FubarDev.FtpServer.Commands.IFeatureInfoProvider.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandActivator.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandDispatcher.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandHandlerInformation.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandHandlerInstanceInformation.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandHandlerProvider.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandHandlerScanner.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandInformation.html
│ ├── FubarDev.FtpServer.Commands.IFtpCommandMiddleware.html
│ ├── FubarDev.FtpServer.Commands.ServiceFtpCommandHandlerScanner.html
│ ├── FubarDev.FtpServer.Commands.html
│ ├── FubarDev.FtpServer.ConnectionChecks.FtpConnectionCheckContext.html
│ ├── FubarDev.FtpServer.ConnectionChecks.FtpConnectionCheckResult.html
│ ├── FubarDev.FtpServer.ConnectionChecks.FtpConnectionEstablishedCheck.html
│ ├── FubarDev.FtpServer.ConnectionChecks.FtpConnectionIdleCheck.html
│ ├── FubarDev.FtpServer.ConnectionChecks.IFtpConnectionCheck.html
│ ├── FubarDev.FtpServer.ConnectionChecks.IFtpConnectionStatusCheck.html
│ ├── FubarDev.FtpServer.ConnectionChecks.html
│ ├── FubarDev.FtpServer.ConnectionEventArgs.html
│ ├── FubarDev.FtpServer.ConnectionExtensions.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.ConnectionStatus.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.ICommunicationService.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.IFtpConnectionAdapter.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.IFtpSecureConnectionAdapter.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.INetworkStreamService.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.NetworkStreamReader.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.NetworkStreamWriter.html
│ ├── FubarDev.FtpServer.ConnectionHandlers.html
│ ├── FubarDev.FtpServer.ConnectionInitAsyncDelegate.html
│ ├── FubarDev.FtpServer.ConnectionStatus.html
│ ├── FubarDev.FtpServer.CreateEncryptedStreamDelegate.html
│ ├── FubarDev.FtpServer.DataConnection.ActiveDataConnectionFeatureFactory.html
│ ├── FubarDev.FtpServer.DataConnection.IFtpDataConnectionValidator.html
│ ├── FubarDev.FtpServer.DataConnection.PassiveDataConnectionFeatureFactory.html
│ ├── FubarDev.FtpServer.DataConnection.PromiscuousPasvDataConnectionValidator.html
│ ├── FubarDev.FtpServer.DataConnection.SecureDataConnectionWrapper.html
│ ├── FubarDev.FtpServer.DataConnection.html
│ ├── FubarDev.FtpServer.DotNetFtpServerBuilderExtensions.html
│ ├── FubarDev.FtpServer.Events.FtpConnectionCommandReceivedEvent.html
│ ├── FubarDev.FtpServer.Events.FtpConnectionDataTransferStartedEvent.html
│ ├── FubarDev.FtpServer.Events.FtpConnectionDataTransferStoppedEvent.html
│ ├── FubarDev.FtpServer.Events.IFtpConnectionEvent.html
│ ├── FubarDev.FtpServer.Events.IFtpConnectionEventHost.html
│ ├── FubarDev.FtpServer.Events.html
│ ├── FubarDev.FtpServer.ExtensionAnnouncementMode.html
│ ├── FubarDev.FtpServer.FeatureHandlerDelgate.html
│ ├── FubarDev.FtpServer.Features.IAuthorizationInformationFeature.html
│ ├── FubarDev.FtpServer.Features.IBackgroundTaskLifetimeFeature.html
│ ├── FubarDev.FtpServer.Features.IConnectionFeature.html
│ ├── FubarDev.FtpServer.Features.IEncodingFeature.html
│ ├── FubarDev.FtpServer.Features.IFileSystemFeature.html
│ ├── FubarDev.FtpServer.Features.IFtpDataConnectionConfigurationFeature.html
│ ├── FubarDev.FtpServer.Features.IFtpDataConnectionFeature.html
│ ├── FubarDev.FtpServer.Features.ILocalizationFeature.html
│ ├── FubarDev.FtpServer.Features.IMlstFactsFeature.html
│ ├── FubarDev.FtpServer.Features.INetworkStreamFeature.html
│ ├── FubarDev.FtpServer.Features.IRenameCommandFeature.html
│ ├── FubarDev.FtpServer.Features.IRestCommandFeature.html
│ ├── FubarDev.FtpServer.Features.ISecureConnectionFeature.html
│ ├── FubarDev.FtpServer.Features.IServerCommandFeature.html
│ ├── FubarDev.FtpServer.Features.ITransferConfigurationFeature.html
│ ├── FubarDev.FtpServer.Features.Impl.BackgroundTaskLifetimeFeature.html
│ ├── FubarDev.FtpServer.Features.Impl.ServerCommandFeature.html
│ ├── FubarDev.FtpServer.Features.Impl.html
│ ├── FubarDev.FtpServer.Features.html
│ ├── FubarDev.FtpServer.FileSystem.DotNet.DotNetDirectoryEntry.html
│ ├── FubarDev.FtpServer.FileSystem.DotNet.DotNetFileEntry.html
│ ├── FubarDev.FtpServer.FileSystem.DotNet.DotNetFileSystem.html
│ ├── FubarDev.FtpServer.FileSystem.DotNet.DotNetFileSystemEntry.html
│ ├── FubarDev.FtpServer.FileSystem.DotNet.DotNetFileSystemOptions.html
│ ├── FubarDev.FtpServer.FileSystem.DotNet.DotNetFileSystemProvider.html
│ ├── FubarDev.FtpServer.FileSystem.DotNet.html
│ ├── FubarDev.FtpServer.FileSystem.EmptyUnixFileSystem.html
│ ├── FubarDev.FtpServer.FileSystem.Error.BadParameterException.html
│ ├── FubarDev.FtpServer.FileSystem.Error.FileNameNotAllowedException.html
│ ├── FubarDev.FtpServer.FileSystem.Error.FileSystemException.html
│ ├── FubarDev.FtpServer.FileSystem.Error.FileUnavailableException.html
│ ├── FubarDev.FtpServer.FileSystem.Error.StorageExceededException.html
│ ├── FubarDev.FtpServer.FileSystem.Error.html
│ ├── FubarDev.FtpServer.FileSystem.FileSystemExtensions.html
│ ├── FubarDev.FtpServer.FileSystem.Generic.GenericAccessMode.html
│ ├── FubarDev.FtpServer.FileSystem.Generic.GenericUnixPermissions.html
│ ├── FubarDev.FtpServer.FileSystem.Generic.html
│ ├── FubarDev.FtpServer.FileSystem.GoogleDrive.GoogleDriveFileSystem.html
│ ├── FubarDev.FtpServer.FileSystem.GoogleDrive.GoogleDriveFileSystemProvider.html
│ ├── FubarDev.FtpServer.FileSystem.GoogleDrive.GoogleDriveOptions.html
│ ├── FubarDev.FtpServer.FileSystem.GoogleDrive.GoogleDriveServiceProvider.html
│ ├── FubarDev.FtpServer.FileSystem.GoogleDrive.IGoogleDriveServiceProvider.html
│ ├── FubarDev.FtpServer.FileSystem.GoogleDrive.html
│ ├── FubarDev.FtpServer.FileSystem.IAccessMode.html
│ ├── FubarDev.FtpServer.FileSystem.IAccountDirectories.html
│ ├── FubarDev.FtpServer.FileSystem.IAccountDirectoryQuery.html
│ ├── FubarDev.FtpServer.FileSystem.IFileSystemClassFactory.html
│ ├── FubarDev.FtpServer.FileSystem.IUnixDirectoryEntry.html
│ ├── FubarDev.FtpServer.FileSystem.IUnixFileEntry.html
│ ├── FubarDev.FtpServer.FileSystem.IUnixFileSystem.html
│ ├── FubarDev.FtpServer.FileSystem.IUnixFileSystemEntry.html
│ ├── FubarDev.FtpServer.FileSystem.IUnixOwner.html
│ ├── FubarDev.FtpServer.FileSystem.IUnixPermissions.html
│ ├── FubarDev.FtpServer.FileSystem.InMemory.InMemoryDirectoryEntry.html
│ ├── FubarDev.FtpServer.FileSystem.InMemory.InMemoryFileEntry.html
│ ├── FubarDev.FtpServer.FileSystem.InMemory.InMemoryFileSystem.html
│ ├── FubarDev.FtpServer.FileSystem.InMemory.InMemoryFileSystemEntry.html
│ ├── FubarDev.FtpServer.FileSystem.InMemory.InMemoryFileSystemOptions.html
│ ├── FubarDev.FtpServer.FileSystem.InMemory.InMemoryFileSystemProvider.html
│ ├── FubarDev.FtpServer.FileSystem.InMemory.html
│ ├── FubarDev.FtpServer.FileSystem.MemoryTemporaryData.html
│ ├── FubarDev.FtpServer.FileSystem.PathEnumerator.html
│ ├── FubarDev.FtpServer.FileSystem.PathNormalizer.html
│ ├── FubarDev.FtpServer.FileSystem.PathSelectionResult.html
│ ├── FubarDev.FtpServer.FileSystem.PathSelectionResultType.html
│ ├── FubarDev.FtpServer.FileSystem.PathSelector.html
│ ├── FubarDev.FtpServer.FileSystem.S3.S3FileSystem.html
│ ├── FubarDev.FtpServer.FileSystem.S3.S3FileSystemOptions.html
│ ├── FubarDev.FtpServer.FileSystem.S3.html
│ ├── FubarDev.FtpServer.FileSystem.SearchResult-1.html
│ ├── FubarDev.FtpServer.FileSystem.Unix.UnixFileSystem.html
│ ├── FubarDev.FtpServer.FileSystem.Unix.UnixFileSystemIdChanger.html
│ ├── FubarDev.FtpServer.FileSystem.Unix.UnixFileSystemOptions.html
│ ├── FubarDev.FtpServer.FileSystem.Unix.UnixFileSystemProvider.html
│ ├── FubarDev.FtpServer.FileSystem.Unix.html
│ ├── FubarDev.FtpServer.FileSystem.html
│ ├── FubarDev.FtpServer.FtpCommand.html
│ ├── FubarDev.FtpServer.FtpCommandCollector.html
│ ├── FubarDev.FtpServer.FtpCommandHandlerContext.html
│ ├── FubarDev.FtpServer.FtpCommandHandlerProcessDelegate.html
│ ├── FubarDev.FtpServer.FtpConnection.html
│ ├── FubarDev.FtpServer.FtpConnectionAccessor.html
│ ├── FubarDev.FtpServer.FtpConnectionContext.html
│ ├── FubarDev.FtpServer.FtpConnectionData.html
│ ├── FubarDev.FtpServer.FtpConnectionOptions.html
│ ├── FubarDev.FtpServer.FtpContext.html
│ ├── FubarDev.FtpServer.FtpFeatureFunctionAttribute.html
│ ├── FubarDev.FtpServer.FtpFeatureTextAttribute.html
│ ├── FubarDev.FtpServer.FtpFileType.html
│ ├── FubarDev.FtpServer.FtpFileTypeInterpreterMode.html
│ ├── FubarDev.FtpServer.FtpLoginStateMachine.html
│ ├── FubarDev.FtpServer.FtpRequestDelegate.html
│ ├── FubarDev.FtpServer.FtpResponse.html
│ ├── FubarDev.FtpServer.FtpResponseAfterWriteAsyncDelegate.html
│ ├── FubarDev.FtpServer.FtpResponseLine.html
│ ├── FubarDev.FtpServer.FtpResponseList-1.html
│ ├── FubarDev.FtpServer.FtpResponseList.html
│ ├── FubarDev.FtpServer.FtpResponseTextBlock.html
│ ├── FubarDev.FtpServer.FtpServer.html
│ ├── FubarDev.FtpServer.FtpServerBuilderExtensions.html
│ ├── FubarDev.FtpServer.FtpServerBuilderExtensionsForChecks.html
│ ├── FubarDev.FtpServer.FtpServerException.html
│ ├── FubarDev.FtpServer.FtpServerHost.html
│ ├── FubarDev.FtpServer.FtpServerOptions.html
│ ├── FubarDev.FtpServer.FtpServerStatistics.html
│ ├── FubarDev.FtpServer.FtpServiceStatus.html
│ ├── FubarDev.FtpServer.FtpStateMachine-1.Transition.html
│ ├── FubarDev.FtpServer.FtpStateMachine-1.html
│ ├── FubarDev.FtpServer.FtpTransferMode.html
│ ├── FubarDev.FtpServer.GenericFeatureInfo.html
│ ├── FubarDev.FtpServer.GoogleDriveFtpServerBuilderExtensions.html
│ ├── FubarDev.FtpServer.HostInfo.html
│ ├── FubarDev.FtpServer.IAccountInformation.html
│ ├── FubarDev.FtpServer.IBackgroundCommandHandler.html
│ ├── FubarDev.FtpServer.IBackgroundTransferHost.html
│ ├── FubarDev.FtpServer.IFeatureHost.html
│ ├── FubarDev.FtpServer.IFeatureInfo.html
│ ├── FubarDev.FtpServer.IFtpCommandBase.html
│ ├── FubarDev.FtpServer.IFtpCommandHandler.html
│ ├── FubarDev.FtpServer.IFtpCommandHandlerExtension.html
│ ├── FubarDev.FtpServer.IFtpConnection.html
│ ├── FubarDev.FtpServer.IFtpConnectionAccessor.html
│ ├── FubarDev.FtpServer.IFtpConnectionKeepAlive.html
│ ├── FubarDev.FtpServer.IFtpControlStreamAdapter.html
│ ├── FubarDev.FtpServer.IFtpDataConnection.html
│ ├── FubarDev.FtpServer.IFtpHost.html
│ ├── FubarDev.FtpServer.IFtpHostSelector.html
│ ├── FubarDev.FtpServer.IFtpLoginStateMachine.html
│ ├── FubarDev.FtpServer.IFtpMiddleware.html
│ ├── FubarDev.FtpServer.IFtpResponse.html
│ ├── FubarDev.FtpServer.IFtpServer.html
│ ├── FubarDev.FtpServer.IFtpServerBuilder.html
│ ├── FubarDev.FtpServer.IFtpServerHost.html
│ ├── FubarDev.FtpServer.IFtpServerStatistics.html
│ ├── FubarDev.FtpServer.IFtpService.html
│ ├── FubarDev.FtpServer.IFtpStateMachine-1.html
│ ├── FubarDev.FtpServer.IListFormatter.html
│ ├── FubarDev.FtpServer.IPasvAddressResolver.html
│ ├── FubarDev.FtpServer.IPasvListener.html
│ ├── FubarDev.FtpServer.IPasvListenerFactory.html
│ ├── FubarDev.FtpServer.IPausableFtpService.html
│ ├── FubarDev.FtpServer.InMemoryFtpServerBuilderExtensions.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.CreateFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.CurrentDirectoryFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.GenericFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.IFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.ModifyFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.ParentDirectoryFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.PermissionsFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.SizeFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.TypeFact.html
│ ├── FubarDev.FtpServer.ListFormatters.Facts.html
│ ├── FubarDev.FtpServer.ListFormatters.FactsListFormatter.html
│ ├── FubarDev.FtpServer.ListFormatters.LongListFormatter.html
│ ├── FubarDev.FtpServer.ListFormatters.ShortListFormatter.html
│ ├── FubarDev.FtpServer.ListFormatters.html
│ ├── FubarDev.FtpServer.ListenerStartedEventArgs.html
│ ├── FubarDev.FtpServer.Localization.DefaultFtpCatalogLoader.html
│ ├── FubarDev.FtpServer.Localization.DefaultFtpServerMessages.html
│ ├── FubarDev.FtpServer.Localization.IFtpCatalogLoader.html
│ ├── FubarDev.FtpServer.Localization.IFtpServerMessages.html
│ ├── FubarDev.FtpServer.Localization.html
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.Directories.PamAccountDirectoryQuery.html
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.Directories.PamAccountDirectoryQueryOptions.html
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.Directories.html
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.PamFtpUser.html
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.PamMembershipProvider.html
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.PamMembershipProviderOptions.html
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.html
│ ├── FubarDev.FtpServer.MultiBindingTcpListener.html
│ ├── FubarDev.FtpServer.PamFtpServerBuilderExtensions.html
│ ├── FubarDev.FtpServer.PasvCommandOptions.html
│ ├── FubarDev.FtpServer.PasvListener.html
│ ├── FubarDev.FtpServer.PasvListenerFactory.html
│ ├── FubarDev.FtpServer.PasvListenerOptions.html
│ ├── FubarDev.FtpServer.PermissionsExtensions.html
│ ├── FubarDev.FtpServer.PortCommandOptions.html
│ ├── FubarDev.FtpServer.S3FtpServerBuilderExtensions.html
│ ├── FubarDev.FtpServer.SecurityActionResult.html
│ ├── FubarDev.FtpServer.SecurityStatus.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.CloseConnectionServerCommandHandler.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.CloseDataConnectionServerCommandHandler.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.DataConnectionServerCommandHandler.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.PauseConnectionServerCommandHandler.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.ResumeConnectionServerCommandHandler.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.SendResponseServerCommandHandler.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.TlsEnableServerCommandHandler.html
│ ├── FubarDev.FtpServer.ServerCommandHandlers.html
│ ├── FubarDev.FtpServer.ServerCommands.AsyncDataConnectionDelegate.html
│ ├── FubarDev.FtpServer.ServerCommands.CloseConnectionServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.CloseDataConnectionServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.DataConnectionServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.DelegateServerCommandExecutor.html
│ ├── FubarDev.FtpServer.ServerCommands.IServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.IServerCommandExecutor.html
│ ├── FubarDev.FtpServer.ServerCommands.IServerCommandHandler-1.html
│ ├── FubarDev.FtpServer.ServerCommands.PauseConnectionServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.ReflectionServerCommandExecutor.html
│ ├── FubarDev.FtpServer.ServerCommands.ResumeConnectionServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.SendResponseServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.TlsEnableServerCommand.html
│ ├── FubarDev.FtpServer.ServerCommands.html
│ ├── FubarDev.FtpServer.SimplePasvAddressResolver.html
│ ├── FubarDev.FtpServer.SimplePasvOptions.html
│ ├── FubarDev.FtpServer.SingleFtpHostSelector.html
│ ├── FubarDev.FtpServer.SystCommandOptions.html
│ ├── FubarDev.FtpServer.TcpSocketClientAccessor.html
│ ├── FubarDev.FtpServer.TelnetInputParser-1.html
│ ├── FubarDev.FtpServer.UnixFsFtpServerBuilderExtensions.html
│ ├── FubarDev.FtpServer.Utilities.DirectoryListingEnumerator.html
│ ├── FubarDev.FtpServer.Utilities.html
│ ├── FubarDev.FtpServer.html
│ ├── Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.html
│ ├── Microsoft.Extensions.DependencyInjection.html
│ ├── index.html
│ └── toc.html
├── articles
│ ├── authentication.html
│ ├── configuration.html
│ ├── custom-authentication.html
│ ├── custom-file-system.html
│ ├── file-systems.html
│ ├── ftps.html
│ ├── google-drive.html
│ ├── intro.html
│ ├── logging.html
│ ├── project-structure.html
│ ├── quickstart-aspnetcore-host.html
│ ├── quickstart-generic-host.html
│ ├── quickstart.html
│ ├── toc.html
│ └── upgrade-3.0.html
├── favicon.ico
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── index.html
├── index.json
├── logo.svg
├── manifest.json
├── rfc
│ ├── rfc1123.txt
│ ├── rfc2228.txt
│ ├── rfc2640.txt
│ ├── rfc3659.txt
│ ├── rfc5797.txt
│ ├── rfc7151.txt
│ └── rfc959.txt
├── search-stopwords.json
├── styles
│ ├── docfx.css
│ ├── docfx.js
│ ├── docfx.vendor.css
│ ├── docfx.vendor.js
│ ├── lunr.js
│ ├── lunr.min.js
│ ├── main.css
│ ├── main.js
│ └── search-worker.js
├── toc.html
└── xrefmap.yml
├── samples
├── QuickStart.AspNetCoreHost
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── QuickStart.AspNetCoreHost.csproj
│ ├── Startup.cs
│ ├── appsettings.Development.json
│ └── appsettings.json
├── QuickStart.GenericHost
│ ├── Program.cs
│ └── QuickStart.GenericHost.csproj
├── QuickStart
│ ├── Program.cs
│ └── QuickStart.csproj
├── TestFtpServer.Api
│ ├── FtpConnectionStatus.cs
│ ├── IFtpServerHost.cs
│ └── TestFtpServer.Api.csproj
├── TestFtpServer.Shell
│ ├── CommandInfoExtensions.cs
│ ├── Commands
│ │ ├── CloseCommandHandler.cs
│ │ ├── CloseConnectionCommandHandler.cs
│ │ ├── ContinueCommandHandler.cs
│ │ ├── ExitCommandHandler.cs
│ │ ├── HelpCommandHandler.cs
│ │ ├── PauseCommandHandler.cs
│ │ ├── ShowCommandHandler.cs
│ │ ├── ShowConnectionsCommandInfo.cs
│ │ ├── StatusCommandHandler.cs
│ │ └── StopCommandHandler.cs
│ ├── FtpShellCommandAutoCompletion.cs
│ ├── ICommandInfo.cs
│ ├── IExecutableCommandInfo.cs
│ ├── IRootCommandInfo.cs
│ ├── IShellStatus.cs
│ ├── Program.cs
│ ├── ServerShell.cs
│ ├── ShellStatus.cs
│ ├── TestFtpServer.Shell.csproj
│ └── appsettings.json
└── TestFtpServer
│ ├── App.config
│ ├── CommandMiddlewares
│ └── FsIdChanger.cs
│ ├── Commands
│ └── HelloFtpCommandHandler.cs
│ ├── Configuration
│ ├── FileSystemAmazonS3Options.cs
│ ├── FileSystemGoogleDriveOptions.cs
│ ├── FileSystemGoogleDriveServiceOptions.cs
│ ├── FileSystemGoogleDriveUserOptions.cs
│ ├── FileSystemInMemoryOptions.cs
│ ├── FileSystemLayoutType.cs
│ ├── FileSystemSystemIoOptions.cs
│ ├── FileSystemType.cs
│ ├── FileSystemUnixOptions.cs
│ ├── FtpConnectionIdleCheckInactivityOptions.cs
│ ├── FtpConnectionIdleCheckOptions.cs
│ ├── FtpConnectionIdleCheckSocketStateOptions.cs
│ ├── FtpOptions.cs
│ ├── FtpServerOptions.cs
│ ├── FtpServerPasvOptions.cs
│ ├── FtpsOptions.cs
│ ├── MembershipProviderType.cs
│ └── PamAuthOptions.cs
│ ├── CustomMembershipProvider.cs
│ ├── Dockerfile
│ ├── Extensions
│ └── SiteHelloFtpCommandHandlerExtension.cs
│ ├── FtpOptionsExtensions.cs
│ ├── FtpServerBuilderExtensions.cs
│ ├── FtpServerHostApi.cs
│ ├── HostedFtpService.cs
│ ├── HostedIpcService.cs
│ ├── NLog.config
│ ├── NLog.xsd
│ ├── Options.cs
│ ├── OptionsConfigSource.cs
│ ├── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── ServerInfo
│ ├── BackgroundUploadsInfo.cs
│ ├── FtpServerInfo.cs
│ ├── IExtendedModuleInfo.cs
│ ├── IModuleInfo.cs
│ └── ISimpleModuleInfo.cs
│ ├── ServiceCollectionExtensions.cs
│ ├── TestFtpServer.csproj
│ ├── Utilities
│ └── Hello.cs
│ └── appsettings.json
├── src
├── FubarDev.FtpServer.Abstractions
│ ├── AccountManagement
│ │ ├── Anonymous
│ │ │ ├── BlockAnonymousValidation.cs
│ │ │ ├── IAnonymousPasswordValidator.cs
│ │ │ ├── NoTopLevelDomainValidation.cs
│ │ │ ├── NoValidation.cs
│ │ │ └── SimpleMailAddressValidation.cs
│ │ ├── AnonymousFtpUser.cs
│ │ ├── AnonymousMembershipProvider.cs
│ │ ├── Compatibility
│ │ │ ├── AnonymousClaimsFtpUser.cs
│ │ │ ├── ClaimsFtpUser.cs
│ │ │ ├── ClaimsPrincipalExtensions.cs
│ │ │ ├── FtpUserExtensions.cs
│ │ │ └── UnixClaimsFtpUser.cs
│ │ ├── Directories
│ │ │ ├── GenericAccountDirectories.cs
│ │ │ ├── RootPerUser
│ │ │ │ ├── RootPerUserAccountDirectoryQuery.cs
│ │ │ │ └── RootPerUserAccountDirectoryQueryOptions.cs
│ │ │ └── SingleRootWithoutHome
│ │ │ │ ├── SingleRootWithoutHomeAccountDirectoryQuery.cs
│ │ │ │ └── SingleRootWithoutHomeAccountDirectoryQueryOptions.cs
│ │ ├── FtpClaimTypes.cs
│ │ ├── IAnonymousFtpUser.cs
│ │ ├── IFtpUser.cs
│ │ ├── IMembershipProvider.cs
│ │ ├── IMembershipProviderAsync.cs
│ │ ├── IUnixUser.cs
│ │ ├── MemberValidationResult.cs
│ │ └── MemberValidationStatus.cs
│ ├── Address.cs
│ ├── Authentication
│ │ ├── AuthenticationMechanism.cs
│ │ ├── IAuthenticationMechanism.cs
│ │ └── ISslStreamWrapperFactory.cs
│ ├── Authorization
│ │ ├── Actions
│ │ │ ├── FillConnectionAccountDataAction.cs
│ │ │ ├── FillConnectionFileSystemDataAction.cs
│ │ │ ├── SetHomeDirectoryAction.cs
│ │ │ └── SetHomeDirectoryActionOptions.cs
│ │ ├── AuthorizationMechanism.cs
│ │ ├── IAuthorizationAction.cs
│ │ ├── IAuthorizationMechanism.cs
│ │ └── PasswordAuthorization.cs
│ ├── BackgroundTransfer
│ │ ├── BackgroundTransferInfo.cs
│ │ ├── BackgroundTransferStatus.cs
│ │ ├── IBackgroundTransfer.cs
│ │ ├── IBackgroundTransferWorker.cs
│ │ ├── ITemporaryData.cs
│ │ ├── ITemporaryDataFactory.cs
│ │ ├── TempFileTemporaryData.cs
│ │ └── TemporaryDataFactory.cs
│ ├── ClaimsIdentityExtensions.cs
│ ├── ClaimsPrincipalExtensions.cs
│ ├── CloseEncryptedStreamDelegate.cs
│ ├── CommandExtensions
│ │ ├── FtpCommandHandlerExtensionAttribute.cs
│ │ ├── IFtpCommandHandlerExtensionInformation.cs
│ │ ├── IFtpCommandHandlerExtensionProvider.cs
│ │ └── IFtpCommandHandlerExtensionScanner.cs
│ ├── Commands
│ │ ├── DefaultFeatureInfoProvider.cs
│ │ ├── DefaultFtpCommandDispatcher.cs
│ │ ├── FoundFeatureInfo.cs
│ │ ├── FtpCommandExecutionDelegate.cs
│ │ ├── FtpCommandHandlerAttribute.cs
│ │ ├── FtpCommandSelection.cs
│ │ ├── FtpExecutionContext.cs
│ │ ├── IFeatureInfoProvider.cs
│ │ ├── IFtpCommandActivator.cs
│ │ ├── IFtpCommandDispatcher.cs
│ │ ├── IFtpCommandHandlerInformation.cs
│ │ ├── IFtpCommandHandlerInstanceInformation.cs
│ │ ├── IFtpCommandHandlerProvider.cs
│ │ ├── IFtpCommandHandlerScanner.cs
│ │ ├── IFtpCommandInformation.cs
│ │ └── IFtpCommandMiddleware.cs
│ ├── ConnectionChecks
│ │ ├── FtpConnectionCheckContext.cs
│ │ ├── FtpConnectionCheckResult.cs
│ │ ├── IFtpConnectionCheck.cs
│ │ └── IFtpConnectionStatusCheck.cs
│ ├── ConnectionEventArgs.cs
│ ├── ConnectionExtensions.cs
│ ├── ConnectionInitAsyncDelegate.cs
│ ├── ConnectionStatus.cs
│ ├── CreateEncryptedStreamDelegate.cs
│ ├── DataConnection
│ │ ├── ActiveDataConnectionFeatureFactory.cs
│ │ ├── IFtpDataConnectionValidator.cs
│ │ ├── PassiveDataConnectionFeatureFactory.cs
│ │ └── SecureDataConnectionWrapper.cs
│ ├── Events
│ │ ├── FtpConnectionCommandReceivedEvent.cs
│ │ ├── FtpConnectionDataTransferStartedEvent.cs
│ │ ├── FtpConnectionDataTransferStoppedEvent.cs
│ │ ├── IFtpConnectionEvent.cs
│ │ └── IFtpConnectionEventHost.cs
│ ├── Features
│ │ ├── IAuthorizationInformationFeature.cs
│ │ ├── IBackgroundTaskLifetimeFeature.cs
│ │ ├── IConnectionFeature.cs
│ │ ├── IEncodingFeature.cs
│ │ ├── IFileSystemFeature.cs
│ │ ├── IFtpDataConnectionFeature.cs
│ │ ├── ILocalizationFeature.cs
│ │ ├── IMlstFactsFeature.cs
│ │ ├── IRenameCommandFeature.cs
│ │ ├── IRestCommandFeature.cs
│ │ ├── ISecureConnectionFeature.cs
│ │ ├── IServerCommandFeature.cs
│ │ ├── ITransferConfigurationFeature.cs
│ │ └── Impl
│ │ │ ├── AuthorizationInformationFeature.cs
│ │ │ ├── BackgroundTaskLifetimeFeature.cs
│ │ │ ├── EncodingFeature.cs
│ │ │ ├── FileSystemFeature.cs
│ │ │ ├── LocalizationFeature.cs
│ │ │ ├── ServerCommandFeature.cs
│ │ │ └── TransferConfigurationFeature.cs
│ ├── FileSystem
│ │ ├── EmptyUnixFileSystem.cs
│ │ ├── Error
│ │ │ ├── BadParameterException.cs
│ │ │ ├── FileNameNotAllowedException.cs
│ │ │ ├── FileSystemException.cs
│ │ │ ├── FileUnavailableException.cs
│ │ │ └── StorageExceededException.cs
│ │ ├── FileSystemExtensions.cs
│ │ ├── Generic
│ │ │ ├── GenericAccessMode.cs
│ │ │ └── GenericUnixPermissions.cs
│ │ ├── IAccessMode.cs
│ │ ├── IAccountDirectories.cs
│ │ ├── IAccountDirectoryQuery.cs
│ │ ├── IFileSystemClassFactory.cs
│ │ ├── IUnixDirectoryEntry.cs
│ │ ├── IUnixFileEntry.cs
│ │ ├── IUnixFileSystem.cs
│ │ ├── IUnixFileSystemEntry.cs
│ │ ├── IUnixOwner.cs
│ │ ├── IUnixPermissions.cs
│ │ ├── ListSegment{T}.cs
│ │ ├── MemoryTemporaryData.cs
│ │ ├── PathEnumerator.cs
│ │ ├── PathNormalizer.cs
│ │ ├── PathSelectionResult.cs
│ │ ├── PathSelectionResultType.cs
│ │ ├── PathSelector.cs
│ │ └── SearchResult{T}.cs
│ ├── FtpCommand.cs
│ ├── FtpCommandHandlerContext.cs
│ ├── FtpConnectionContext.cs
│ ├── FtpConnectionData.cs
│ ├── FtpContext.cs
│ ├── FtpFeatureFunctionAttribute.cs
│ ├── FtpFeatureTextAttribute.cs
│ ├── FtpFileType.cs
│ ├── FtpFileTypeInterpreterMode.cs
│ ├── FtpLoginStateMachine.cs
│ ├── FtpRequestDelegate.cs
│ ├── FtpResponse.cs
│ ├── FtpResponseAfterWriteDelegate.cs
│ ├── FtpResponseLine.cs
│ ├── FtpResponseList.cs
│ ├── FtpResponseListStatus.cs
│ ├── FtpResponseList{TStatus}.cs
│ ├── FtpResponseTextBlock.cs
│ ├── FtpServerBuilderExtensions.cs
│ ├── FtpServiceStatus.cs
│ ├── FtpStateMachine.cs
│ ├── FtpTransferMode.cs
│ ├── FubarDev.FtpServer.Abstractions.csproj
│ ├── GenericFeatureInfo.cs
│ ├── HostInfo.cs
│ ├── IAccountInformation.cs
│ ├── IBackgroundCommandHandler.cs
│ ├── IFeatureHost.cs
│ ├── IFeatureInfo.cs
│ ├── IFtpCommandBase.cs
│ ├── IFtpCommandHandler.cs
│ ├── IFtpCommandHandlerExtension.cs
│ ├── IFtpConnection.cs
│ ├── IFtpConnectionAccessor.cs
│ ├── IFtpConnectionConfigurator.cs
│ ├── IFtpConnectionKeepAlive.cs
│ ├── IFtpControlStreamAdapter.cs
│ ├── IFtpDataConnection.cs
│ ├── IFtpHost.cs
│ ├── IFtpHostSelector.cs
│ ├── IFtpListenerService.cs
│ ├── IFtpLoginStateMachine.cs
│ ├── IFtpMiddleware.cs
│ ├── IFtpResponse.cs
│ ├── IFtpServer.cs
│ ├── IFtpServerBuilder.cs
│ ├── IFtpServerStatistics.cs
│ ├── IFtpService.cs
│ ├── IFtpStateMachine.cs
│ ├── IListFormatter.cs
│ ├── IPasvAddressResolver.cs
│ ├── IPasvListener.cs
│ ├── IPasvListenerFactory.cs
│ ├── IPausableFtpService.cs
│ ├── ListFormatters
│ │ ├── Facts
│ │ │ ├── CreateFact.cs
│ │ │ ├── CurrentDirectoryFact.cs
│ │ │ ├── GenericFact.cs
│ │ │ ├── IFact.cs
│ │ │ ├── ModifyFact.cs
│ │ │ ├── ParentDirectoryFact.cs
│ │ │ ├── PermissionsFact.cs
│ │ │ ├── SizeFact.cs
│ │ │ └── TypeFact.cs
│ │ ├── FactsListFormatter.cs
│ │ ├── LongListFormatter.cs
│ │ └── ShortListFormatter.cs
│ ├── ListenerStartedEventArgs.cs
│ ├── Localization
│ │ ├── DefaultFtpServerMessages.cs
│ │ ├── EmptyLocalizationCatalog.cs
│ │ ├── IFtpCatalogLoader.cs
│ │ ├── IFtpServerMessages.cs
│ │ └── ILocalizationCatalog.cs
│ ├── PasvListenerOptions.cs
│ ├── PathExtensions.cs
│ ├── PermissionsExtensions.cs
│ ├── SecurityActionResult.cs
│ ├── SecurityStatus.cs
│ ├── ServerCommands
│ │ ├── AsyncDataConnectionDelegate.cs
│ │ ├── CloseConnectionServerCommand.cs
│ │ ├── CloseDataConnectionServerCommand.cs
│ │ ├── DataConnectionServerCommand.cs
│ │ ├── IServerCommand.cs
│ │ ├── IServerCommandHandler{TCommand}.cs
│ │ └── SendResponseServerCommand.cs
│ └── Utilities
│ │ └── DirectoryListingEnumerator.cs
├── FubarDev.FtpServer.Commands
│ ├── CommandExtensions
│ │ ├── FtpCommandHandlerExtension.cs
│ │ ├── OptsMlstCommandExtension.cs
│ │ ├── OptsUtf8CommandExtension.cs
│ │ ├── SiteBlstCommandExtension.cs
│ │ └── SiteUtimeCommandExtension.cs
│ ├── CommandHandlers
│ │ ├── AborCommandHandler.cs
│ │ ├── AcctCommandHandler.cs
│ │ ├── AdatCommandHandler.cs
│ │ ├── AlloCommandHandler.cs
│ │ ├── AppeCommandHandler.cs
│ │ ├── AuthCommandHandler.cs
│ │ ├── CdUpCommandHandler.cs
│ │ ├── CwdCommandHandler.cs
│ │ ├── DeleCommandHandler.cs
│ │ ├── FeatCommandHandler.cs
│ │ ├── FtpCommandHandler.cs
│ │ ├── HelpCommandHandler.cs
│ │ ├── HostCommandHandler.cs
│ │ ├── IFtpCommandHandlerExtensionHost.cs
│ │ ├── LangCommandHandler.cs
│ │ ├── ListCommandHandler.cs
│ │ ├── MdtmCommandHandler.cs
│ │ ├── MfctCommandHandler.cs
│ │ ├── MffCommandHandler.cs
│ │ ├── MfmtCommandHandler.cs
│ │ ├── MkdCommandHandler.cs
│ │ ├── MlstCommandHandler.cs
│ │ ├── ModeCommandHandler.cs
│ │ ├── NoOpCommandHandler.cs
│ │ ├── OptsCommandHandler.cs
│ │ ├── PassCommandHandler.cs
│ │ ├── PasvCommandHandler.cs
│ │ ├── PbszCommandHandler.cs
│ │ ├── PortCommandHandler.cs
│ │ ├── ProtCommandHandler.cs
│ │ ├── PwdCommandHandler.cs
│ │ ├── QuitCommandHandler.cs
│ │ ├── ReinCommandHandler.cs
│ │ ├── RestCommandHandler.cs
│ │ ├── RetrCommandHandler.cs
│ │ ├── RmdCommandHandler.cs
│ │ ├── RnfrCommandHandler.cs
│ │ ├── RntoCommandHandler.cs
│ │ ├── SiteCommandHandler.cs
│ │ ├── SizeCommandHandler.cs
│ │ ├── StatCommandHandler.cs
│ │ ├── StorCommandHandler.cs
│ │ ├── StruCommandHandler.cs
│ │ ├── SystCommandHandler.cs
│ │ ├── TypeCommandHandler.cs
│ │ ├── UserCommandHandler.cs
│ │ ├── XcwdCommandHandler.cs
│ │ ├── XmkdCommandHandler.cs
│ │ └── XrmdCommandHandler.cs
│ ├── DataConnection
│ │ └── PromiscuousPasvDataConnectionValidator.cs
│ ├── Features
│ │ ├── IFtpDataConnectionConfigurationFeature.cs
│ │ └── Impl
│ │ │ ├── FtpDataConnectionConfigurationFeature.cs
│ │ │ └── MlstFactsFeature.cs
│ ├── FtpLogExtensions.cs
│ ├── FubarDev.FtpServer.Commands.csproj
│ ├── PasvCommandOptions.cs
│ ├── PortCommandOptions.cs
│ ├── StringExtensions.cs
│ ├── SystCommandOptions.cs
│ └── Utilities
│ │ └── Options.cs
├── FubarDev.FtpServer.FileSystem.DotNet
│ ├── DotNetDirectoryEntry.cs
│ ├── DotNetFileEntry.cs
│ ├── DotNetFileSystem.cs
│ ├── DotNetFileSystemEntry.cs
│ ├── DotNetFileSystemOptions.cs
│ ├── DotNetFileSystemProvider.cs
│ ├── DotNetFtpServerBuilderExtensions.cs
│ └── FubarDev.FtpServer.FileSystem.DotNet.csproj
├── FubarDev.FtpServer.FileSystem.GoogleDrive
│ ├── BackgroundUpload.cs
│ ├── FileExtensions.cs
│ ├── FubarDev.FtpServer.FileSystem.GoogleDrive.csproj
│ ├── GoogleDriveDirectoryEntry.cs
│ ├── GoogleDriveDownloadStream.cs
│ ├── GoogleDriveFileEntry.cs
│ ├── GoogleDriveFileSystem.cs
│ ├── GoogleDriveFileSystemProvider.cs
│ ├── GoogleDriveFtpServerBuilderExtensions.cs
│ ├── GoogleDriveOptions.cs
│ ├── GoogleDriveServiceProvider.cs
│ ├── IGoogleDriveFileSystem.cs
│ ├── IGoogleDriveServiceProvider.cs
│ └── StringExtensions.cs
├── FubarDev.FtpServer.FileSystem.InMemory
│ ├── FubarDev.FtpServer.FileSystem.InMemory.csproj
│ ├── InMemoryDirectoryEntry.cs
│ ├── InMemoryFileEntry.cs
│ ├── InMemoryFileSystem.cs
│ ├── InMemoryFileSystemEntry.cs
│ ├── InMemoryFileSystemOptions.cs
│ ├── InMemoryFileSystemProvider.cs
│ └── InMemoryFtpServerBuilderExtensions.cs
├── FubarDev.FtpServer.FileSystem.S3
│ ├── FubarDev.FtpServer.FileSystem.S3.csproj
│ ├── S3DirectoryEntry.cs
│ ├── S3FileEntry.cs
│ ├── S3FileSystem.cs
│ ├── S3FileSystemEntry.cs
│ ├── S3FileSystemOptions.cs
│ ├── S3FileSystemProvider.cs
│ ├── S3FtpServerBuilderExtensions.cs
│ └── S3Path.cs
├── FubarDev.FtpServer.FileSystem.Unix
│ ├── FubarDev.FtpServer.FileSystem.Unix.csproj
│ ├── UnixDirectoryEntry.cs
│ ├── UnixFileEntry.cs
│ ├── UnixFileSystem.cs
│ ├── UnixFileSystemEntry.cs
│ ├── UnixFileSystemOptions.cs
│ ├── UnixFileSystemProvider.cs
│ ├── UnixFsFtpServerBuilderExtensions.cs
│ ├── UnixPermissionExtensions.cs
│ └── UnixPermissions.cs
├── FubarDev.FtpServer.MembershipProvider.Pam
│ ├── Directories
│ │ ├── PamAccountDirectoryQuery.cs
│ │ └── PamAccountDirectoryQueryOptions.cs
│ ├── FubarDev.FtpServer.MembershipProvider.Pam.csproj
│ ├── PamFtpServerBuilderExtensions.cs
│ ├── PamFtpUser.cs
│ ├── PamMembershipProvider.cs
│ ├── PamMembershipProviderOptions.cs
│ ├── PamSessionAuthorizationAction.cs
│ └── PamSessionFeature.cs
├── FubarDev.FtpServer.Shared
│ ├── ExceptionExtensions.cs
│ ├── FubarDev.FtpServer.Shared.projitems
│ ├── FubarDev.FtpServer.Shared.shproj
│ └── StreamExtensions.cs
└── FubarDev.FtpServer
│ ├── AuthTlsOptions.cs
│ ├── Authentication
│ ├── DefaultSslStreamWrapperFactory.cs
│ └── TlsAuthenticationMechanism.cs
│ ├── BackgroundTransfer
│ ├── BackgroundCommandHandler.cs
│ ├── BackgroundTransferEntry.cs
│ ├── BackgroundTransferQueue.cs
│ └── BackgroundTransferWorker.cs
│ ├── CommandExtensions
│ ├── AssemblyFtpCommandHandlerExtensionScanner.cs
│ ├── DefaultFtpCommandHandlerExtensionProvider.cs
│ ├── FtpCommandHandlerExtensionTypeExtensions.cs
│ ├── IFtpCommandHandlerExtensionInstanceInformation.cs
│ └── ServiceFtpCommandHandlerExtensionScanner.cs
│ ├── Commands
│ ├── AssemblyFtpCommandHandlerScanner.cs
│ ├── DefaultFtpCommandActivator.cs
│ ├── DefaultFtpCommandHandlerProvider.cs
│ ├── FtpCommandHandlerTypeExtensions.cs
│ └── ServiceFtpCommandHandlerScanner.cs
│ ├── ConnectionChecks
│ ├── FtpConnectionEstablishedCheck.cs
│ └── FtpConnectionIdleCheck.cs
│ ├── ConnectionHandlers
│ ├── IFtpConnectionAdapter.cs
│ ├── IFtpSecureConnectionAdapter.cs
│ ├── PassThroughConnectionAdapter.cs
│ ├── SecureConnectionAdapter.cs
│ └── SslStreamConnectionAdapter.cs
│ ├── CoreFtpServerBuilderExtensions.cs
│ ├── Features
│ ├── INetworkStreamFeature.cs
│ └── Impl
│ │ └── NetworkStreamFeature.cs
│ ├── FtpCommandCollector.cs
│ ├── FtpConnection.cs
│ ├── FtpConnectionAccessor.cs
│ ├── FtpConnectionKeepAlive.cs
│ ├── FtpConnectionOptions.cs
│ ├── FtpLogExtensions.cs
│ ├── FtpServer.cs
│ ├── FtpServerBuilderExtensionsForChecks.cs
│ ├── FtpServerHost.cs
│ ├── FtpServerOptions.cs
│ ├── FtpServerStatistics.cs
│ ├── FubarDev.FtpServer.csproj
│ ├── IFtpServerHost.cs
│ ├── Localization
│ └── DefaultFtpCatalogLoader.cs
│ ├── MultiBindingTcpListener.cs
│ ├── Networking
│ ├── DefaultFtpListenerService.cs
│ ├── FtpServerListenerService.cs
│ ├── PassThroughService.cs
│ ├── PausableFtpService.cs
│ ├── SimplePipeStream.cs
│ ├── StreamPipeReaderService.cs
│ └── StreamPipeWriterService.cs
│ ├── PasvListener.cs
│ ├── PasvListenerFactory.cs
│ ├── ServerCommandHandlers
│ ├── CloseConnectionServerCommandHandler.cs
│ ├── CloseDataConnectionServerCommandHandler.cs
│ ├── DataConnectionServerCommandHandler.cs
│ ├── PauseConnectionServerCommandHandler.cs
│ ├── ResumeConnectionServerCommandHandler.cs
│ ├── SendResponseServerCommandHandler.cs
│ └── TlsEnableServerCommandHandler.cs
│ ├── ServerCommands
│ ├── DelegateServerCommandExecutor.cs
│ ├── IServerCommandExecutor.cs
│ ├── PauseConnectionServerCommand.cs
│ ├── ReflectionServerCommandExecutor.cs
│ ├── ResumeConnectionServerCommand.cs
│ └── TlsEnableServerCommand.cs
│ ├── ServiceCollectionExtensions.cs
│ ├── SimplePasvAddressResolver.cs
│ ├── SimplePasvOptions.cs
│ ├── SingleFtpHostSelector.cs
│ ├── TcpSocketClientAccessor.cs
│ ├── TelnetInputParser{T}.cs
│ └── Utilities
│ └── NetworkStreamServiceExtensions.cs
├── stylecop.json
├── test
└── FubarDev.FtpServer.Tests
│ ├── AddressTests.cs
│ ├── FtpCommandCollectorTests.cs
│ ├── FtpServerTestsBase.cs
│ ├── FubarDev.FtpServer.Tests.csproj
│ ├── FubarDev.FtpServer.Tests.v3.ncrunchproject
│ ├── IntegrationTests.cs
│ ├── Issues
│ ├── Issue30CustomFtpUser.cs
│ └── Issue82ProtocolViolation.cs
│ └── PathTests.cs
└── third-party
├── DotNet.Glob
├── DotNet.Glob.projitems
├── DotNet.Glob.shproj
├── Evaluation
│ ├── AnyCharacterTokenEvaluator.cs
│ ├── CharacterListTokenEvaluator.cs
│ ├── CharacterListTokenEvaluatorCaseInsensitive.cs
│ ├── CompositeTokenEvaluator.cs
│ ├── GlobTokenEvaluator.cs
│ ├── GlobTokenEvaluatorFactory.cs
│ ├── GlobTokenMatchAnalysisEvaluator.cs
│ ├── IGlobTokenEvaluator.cs
│ ├── IGlobTokenEvaluatorFactory.cs
│ ├── LetterRangeTokenEvaluator.cs
│ ├── LetterRangeTokenEvaluatorCaseInsensitive.cs
│ ├── LiteralTokenEvaluator.cs
│ ├── LiteralTokenEvaluatorCaseInsensitive.cs
│ ├── NumberRangeTokenEvaluator.cs
│ ├── PathSeperatorTokenEvaluator.cs
│ ├── WildcardDirectoryTokenEvaluator.cs
│ └── WildcardTokenEvaluator.cs
├── EvaluationOptions.cs
├── Formatting
│ └── GlobTokenFormatter.cs
├── Generation
│ ├── AnyCharacterTokenMatchGenerator.cs
│ ├── CharacterListTokenMatchGenerator.cs
│ ├── CompositeTokenMatchGenerator.cs
│ ├── GlobMatchGeneratorExtensions.cs
│ ├── GlobTestMatchGenerator.cs
│ ├── IMatchGenerator.cs
│ ├── LetterRangeTokenMatchGenerator.cs
│ ├── LiteralTokenMatchGenerator.cs
│ ├── NumberRangeTokenMatchGenerator.cs
│ ├── PathSeperatorMatchGenerator.cs
│ ├── WildcardDirectoryTokenMatchGenerator.cs
│ └── WildcardTokenMatchGenerator.cs
├── Glob.cs
├── GlobBuilder.cs
├── GlobOptions.cs
├── GlobStringReader.cs
├── GlobTokenMatch.cs
├── GlobTokeniser.cs
├── IGlobBuilder.cs
├── IGlobTokenVisitor.cs
├── LICENSE
├── MatchInfo.cs
├── PathSeperatorKind.cs
└── Token
│ ├── AnyCharacterToken.cs
│ ├── CharacterListToken.cs
│ ├── IGlobToken.cs
│ ├── INegatableToken.cs
│ ├── IVisitable.cs
│ ├── LetterRangeToken.cs
│ ├── LiteralToken.cs
│ ├── NumberRangeToken.cs
│ ├── PathSeperatorToken.cs
│ ├── RangeToken.cs
│ ├── WildcardDirectoryToken.cs
│ └── WildcardToken.cs
├── GnuSslStream
├── GnuSslStream.cs
├── GnuSslStream.projitems
├── GnuSslStream.shproj
├── NativeApi.cs
├── ReflectUtil.cs
└── SslDirectCall.cs
└── ReadLine
├── Abstractions
├── Console2.cs
└── IConsole.cs
├── IAutoCompleteHandler.cs
├── KeyHandler.cs
├── LICENSE
├── ReadLine.cs
├── ReadLine.projitems
└── ReadLine.shproj
/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.dockerignore
2 | **/.env
3 | **/.git
4 | **/.gitignore
5 | **/.vs
6 | **/.vscode
7 | **/*.*proj.user
8 | **/azds.yaml
9 | **/charts
10 | **/bin
11 | **/obj
12 | **/Dockerfile
13 | **/Dockerfile.develop
14 | **/docker-compose.yml
15 | **/docker-compose.*.yml
16 | **/*.dbmdl
17 | **/*.jfm
18 | **/secrets.dev.yaml
19 | **/values.dev.yaml
20 | **/.toolstarget
21 | **/*.pfx
22 | **/appsettings.Development.json
23 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: fubar-coder
4 | patreon: FubarDevelopment
5 |
--------------------------------------------------------------------------------
/FubarDev.FtpServer.ruleset:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/FubarDev.FtpServer.v3.ncrunchsolution:
--------------------------------------------------------------------------------
1 |
2 |
3 | True
4 | Optimised
5 | True
6 |
7 |
--------------------------------------------------------------------------------
/GitVersion.yml:
--------------------------------------------------------------------------------
1 | assembly-versioning-scheme: MajorMinorPatch
2 | next-version: 3.0.0
3 | mode: ContinuousDeployment
4 |
--------------------------------------------------------------------------------
/GlobalAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | using System.Reflection;
9 | using System.Runtime.CompilerServices;
10 |
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: InternalsVisibleTo("FubarDev.FtpServer.Tests")]
15 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Fubar Development Junker
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | **THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.**
22 |
--------------------------------------------------------------------------------
/docfx_project/.gitignore:
--------------------------------------------------------------------------------
1 | ###############
2 | # folder #
3 | ###############
4 | /**/DROP/
5 | /**/TEMP/
6 | /**/packages/
7 | /**/bin/
8 | /**/obj/
9 | _site
10 |
--------------------------------------------------------------------------------
/docfx_project/api/.gitignore:
--------------------------------------------------------------------------------
1 | ###############
2 | # temp file #
3 | ###############
4 | *.yml
5 | .manifest
6 |
--------------------------------------------------------------------------------
/docfx_project/api/index.md:
--------------------------------------------------------------------------------
1 | # API documentation
2 |
3 | This is the documentation for the current version of the FTP server.
4 |
5 | The most important parts of the API are:
6 |
7 | * [IFtpServer](xref:FubarDev.FtpServer.IFtpServer) the FTP server itself
8 | * [FtpServerOptions](xref:FubarDev.FtpServer.FtpServerOptions) for the FTP server transport configuration
9 | * [FtpConnectionOptions](xref:FubarDev.FtpServer.FtpConnectionOptions) to configure the default control connection text encoding
10 | * [AuthTlsOptions](xref:FubarDev.FtpServer.AuthTlsOptions) for the FTPS configuration
11 | * [DotNetFileSystemOptions](xref:FubarDev.FtpServer.FileSystem.DotNet.DotNetFileSystemOptions) to configure the file system access
12 |
--------------------------------------------------------------------------------
/docfx_project/articles/custom-authentication.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: custom-account-management
3 | title: Custom Account Management Development
4 | ---
5 |
6 | > [!WARNING]
7 | > This guide is under construction!
8 |
9 | # Overview
10 |
11 | This article will show you how to develop your own account management.
12 |
13 | > [!WARNING]
14 | > This is a very advanced topic requiring solid knowledge of .NET.
15 |
16 | # Interfaces
17 |
18 | The following interface must be implemented:
19 |
20 | - `IMembershipProvider` is used to authorize the user
21 |
--------------------------------------------------------------------------------
/docfx_project/articles/custom-file-system.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: custom-file-system
3 | title: Custom File System Development
4 | ---
5 |
6 | > [!WARNING]
7 | > This guide is under construction!
8 |
9 | # Overview
10 |
11 | This article will show you how to develop your own file system.
12 |
13 | > [!WARNING]
14 | > This is a very advanced topic requiring solid knowledge of .NET.
15 |
16 | # Interfaces
17 |
18 | The following interfaces must be implemented:
19 |
20 | - `IFileSystemClassFactory` is used to get user-specific file system access
21 | - `IUnixFileSystem` provides the main file system operations
22 | - `IUnixDirectoryEntry` represents a directory entry
23 | - `IUnixFileEntry` represents a file entry
24 |
25 |
--------------------------------------------------------------------------------
/docfx_project/articles/file-systems.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: file-systems
3 | title: File Systems
4 | ---
5 |
6 | # Overview
7 |
8 | The FTP server provides two file systems by default:
9 |
10 | - `System.IO`-based file system
11 | - Google Drive-based file system
12 |
13 | The `System.IO`-based file system is usually what you want and the Google Drive-based file system is a proof-of-concept.
14 |
15 | ## `System.IO`-based file system
16 |
17 | This file system just uses the operating systems underlying file system and serves it to the user.
18 |
19 | ### Configuration
20 |
21 | Here is an example of a configuration:
22 |
23 | ```csharp
24 | services.Configure(cfg => {
25 | cfg.RootPath = "/your/root/path";
26 | });
27 | ```
28 |
29 | You can also configure the following:
30 |
31 | - Usage of the user ID as subdirectory
32 | - Is deletion of non-empty directories allowed?
33 |
34 | ## Google Drive-based file system
35 |
36 | This topic is explained in a [separate article](xref:google-drive).
37 |
38 | ## Your own file system
39 |
40 | This topic is explained in a [separate article](xref:custom-file-system).
41 |
--------------------------------------------------------------------------------
/docfx_project/articles/ftps.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ftps
3 | title: FTP over SSL/TLS
4 | ---
5 |
6 | # Introduction
7 |
8 | The FTPS support enables encrypted communication with the server.
9 |
10 | # How to use FTPS
11 |
12 | FTPS is automatically enabled as soon as you have set an X509 certificate with private key (read: the `X509Certificate2` from a `.pfx`/`.pkcs12` file) in the [AuthTlsOptions](xref:FubarDev.FtpServer.AuthTlsOptions).
13 |
14 | # Example
15 |
16 | ```csharp
17 | var cert = new X509Certificate2("my.pfx", "my-super-strong-password-that-nobody-knows");
18 | services.Configure(cfg => cfg.ServerCertificate = cert);
19 | ```
20 |
21 | # Epilogue
22 |
23 | You can test this - like many other things - using the sample application in the repository.
24 |
--------------------------------------------------------------------------------
/docfx_project/articles/intro.md:
--------------------------------------------------------------------------------
1 | # Install from NuGet.org
2 |
3 | The project is split into multiple packages:
4 |
5 | Package | Description
6 | --------|-------------
7 | FubarDev.FtpServer | The FTP server implementation
8 | FubarDev.FtpServer.Abstractions | The base classes/interfaces; Reference this to implement custom commands, file systems, authentication
9 | FubarDev.FtpServer.Commands | The FTP commands implemented for this FTP server
10 | FubarDev.FtpServer.FileSystem.DotNet | The System.IO-based file system access
11 | FubarDev.FtpServer.FileSystem.GoogleDrive | Google Drive as virtual file system
12 |
13 | ## Getting Started
14 |
15 | * Check out the tour of FluentMigrator in our [Quickstart](xref:quickstart)
16 |
17 | ## Basic topics
18 |
19 | * [Configuration](xref:configuration)
20 | * [Logging](xref:logging)
21 | * [Authentication](xref:authentication)
22 | * [File Systems](xref:file-systems)
23 |
24 | ## Advanced topics
25 |
26 | * [Logging](xref:logging)
27 | * [FTPS](xref:ftps)
28 | * [Google Drive](xref:google-drive)
29 | * [Custom File System Development](xref:custom-file-system)
30 | * [Custom Account Management](xref:custom-account-management)
31 |
--------------------------------------------------------------------------------
/docfx_project/articles/quickstart.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: quickstart
3 | title: Your first FTP server
4 | ---
5 |
6 | # Creating a project
7 |
8 | ```bash
9 | mkdir ftpserver
10 | cd ftpserver
11 | dotnet new console
12 | ```
13 |
14 | # Adding the NuGet packages
15 |
16 | ```bash
17 | # For dependency injection support (required)
18 | dotnet add package Microsoft.Extensions.DependencyInjection
19 |
20 | # For the main FTP server
21 | dotnet add package FubarDev.FtpServer
22 |
23 | # For the System.IO-based file system access
24 | dotnet add package FubarDev.FtpServer.FileSystem.DotNet
25 | ```
26 |
27 | # Using the FTP server
28 |
29 | Change your `Program.cs` to the following code:
30 |
31 | [!code-cs[Program.cs](../code-snippets/quickstart/Program.cs "The FTP server")]
32 |
33 | # Starting the FTP server
34 |
35 | ```bash
36 | dotnet run
37 | ```
38 |
39 | Now your FTP server should be accessible at `127.0.0.1:21`.
40 |
--------------------------------------------------------------------------------
/docfx_project/articles/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Introduction
2 | href: intro.md
3 | - name: Quickstart
4 | href: xref:quickstart
5 | - name: Integration
6 | items:
7 | - name: ASP.NET Core
8 | href: xref:quickstart-aspnetcore-host
9 | - name: Generic Host
10 | href: xref:quickstart-generic-host
11 | - name: Basics
12 | items:
13 | - name: Configuration
14 | href: xref:configuration
15 | - name: Logging
16 | href: xref:logging
17 | - name: Authentication
18 | href: xref:authentication
19 | - name: File Systems
20 | href: xref:file-systems
21 | - name: Advanced Topics
22 | items:
23 | - name: Logging
24 | href: xref:logging
25 | - name: FTPS
26 | href: xref:ftps
27 | - name: Google Drive
28 | href: xref:google-drive
29 | - name: Project structure
30 | href: xref:project-structure
31 | - name: Custom File System
32 | href: xref:custom-file-system
33 | - name: Custom Account Management
34 | href: xref:custom-account-management
35 | - name: Guides
36 | items:
37 | - name: Upgrade to 3.0
38 | href: xref:upgrade-to-3.0
39 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/logging-nlog/QuickStart.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp2.2
6 | QuickStart
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | PreserveNewest
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/logging-nlog/nlog.config:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/logging-serilog/QuickStart.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp2.2
6 | QuickStart
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-2.x/QuickStart.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp2.2
6 | QuickStart
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-aspnetcore-host/HostedFtpService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using FubarDev.FtpServer;
4 | using Microsoft.Extensions.Hosting;
5 |
6 | namespace TestAspNetCoreHost
7 | {
8 | internal class HostedFtpService : IHostedService
9 | {
10 | private readonly IFtpServerHost _ftpServerHost;
11 |
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The FTP server host that gets wrapped as a hosted service.
16 | public HostedFtpService(
17 | IFtpServerHost ftpServerHost)
18 | {
19 | _ftpServerHost = ftpServerHost;
20 | }
21 |
22 | ///
23 | public Task StartAsync(CancellationToken cancellationToken)
24 | {
25 | return _ftpServerHost.StartAsync(cancellationToken);
26 | }
27 |
28 | ///
29 | public Task StopAsync(CancellationToken cancellationToken)
30 | {
31 | return _ftpServerHost.StopAsync(cancellationToken);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-aspnetcore-host/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:1745",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "TestAspNetCoreHost": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-aspnetcore-host/TestAspNetCoreHost.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.2
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-aspnetcore-host/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-aspnetcore-host/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-generic-host/HostedFtpService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using FubarDev.FtpServer;
4 | using Microsoft.Extensions.Hosting;
5 |
6 | namespace TestGenericHost
7 | {
8 | internal class HostedFtpService : IHostedService
9 | {
10 | private readonly IFtpServerHost _ftpServerHost;
11 |
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The FTP server host that gets wrapped as a hosted service.
16 | public HostedFtpService(
17 | IFtpServerHost ftpServerHost)
18 | {
19 | _ftpServerHost = ftpServerHost;
20 | }
21 |
22 | ///
23 | public Task StartAsync(CancellationToken cancellationToken)
24 | {
25 | return _ftpServerHost.StartAsync(cancellationToken);
26 | }
27 |
28 | ///
29 | public Task StopAsync(CancellationToken cancellationToken)
30 | {
31 | return _ftpServerHost.StopAsync(cancellationToken);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart-generic-host/TestGenericHost.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp2.2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docfx_project/code-snippets/quickstart/QuickStart.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp2.2
6 | QuickStart
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docfx_project/index.md:
--------------------------------------------------------------------------------
1 | # FTP server
2 |
3 | This FTP Server is a pure .NET implementation with the following goals:
4 |
5 | - Easy to use
6 | - Extensible
7 | - Virtual file system support
8 | - User-defined authentication
9 |
10 | ## Getting started
11 |
12 | There is a [quickstart tutorial](xref:quickstart) available.
13 |
14 | ## What does it look like?
15 |
16 | [!code-cs[Program.cs](code-snippets/quickstart/Program.cs#L17-L48 "Main program code")]
17 |
18 | ## ASP.NET Core integration
19 |
20 | You can also add the FTP server to your ASP.NET Core application by
21 | following the instructions in this [quickstart tutorial for ASP.NET Core](xref:quickstart-aspnetcore-host).
22 |
23 | ## Further information
24 |
25 | You find more information on the [articles overview](articles/intro.md).
26 |
--------------------------------------------------------------------------------
/docfx_project/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Articles
2 | href: articles/
3 | - name: Api Documentation
4 | href: api/
5 | homepage: api/index.md
6 |
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FubarDevelopment/FtpServer/8bfbe96e0abad36791a1a1601da62a84eb7af841/docs/favicon.ico
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FubarDevelopment/FtpServer/8bfbe96e0abad36791a1a1601da62a84eb7af841/docs/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FubarDevelopment/FtpServer/8bfbe96e0abad36791a1a1601da62a84eb7af841/docs/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FubarDevelopment/FtpServer/8bfbe96e0abad36791a1a1601da62a84eb7af841/docs/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FubarDevelopment/FtpServer/8bfbe96e0abad36791a1a1601da62a84eb7af841/docs/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/docs/styles/main.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FubarDevelopment/FtpServer/8bfbe96e0abad36791a1a1601da62a84eb7af841/docs/styles/main.css
--------------------------------------------------------------------------------
/docs/styles/main.js:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.
2 |
--------------------------------------------------------------------------------
/docs/toc.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/samples/QuickStart.AspNetCoreHost/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:61484",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "QuickStart.AspNetCoreHost": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/samples/QuickStart.AspNetCoreHost/QuickStart.AspNetCoreHost.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | InProcess
6 | false
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/QuickStart.AspNetCoreHost/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/samples/QuickStart.AspNetCoreHost/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning"
5 | }
6 | },
7 | "AllowedHosts": "*"
8 | }
9 |
--------------------------------------------------------------------------------
/samples/QuickStart.GenericHost/QuickStart.GenericHost.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | false
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/samples/QuickStart/QuickStart.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net48
6 | true
7 | false
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | PreserveNewest
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/samples/TestFtpServer.Api/TestFtpServer.Api.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | netstandard2.0
6 | false
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/samples/TestFtpServer.Shell/ICommandInfo.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 | using System.Threading;
7 |
8 | namespace TestFtpServer.Shell
9 | {
10 | ///
11 | /// Interface for the command information.
12 | ///
13 | public interface ICommandInfo
14 | {
15 | ///
16 | /// Gets the name of the command.
17 | ///
18 | string Name { get; }
19 |
20 | ///
21 | /// Gets the alternative names.
22 | ///
23 | IReadOnlyCollection AlternativeNames { get; }
24 |
25 | ///
26 | /// Gets the sub-commands.
27 | ///
28 | /// The cancellation token.
29 | IAsyncEnumerable GetSubCommandsAsync(CancellationToken cancellationToken);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/samples/TestFtpServer.Shell/IExecutableCommandInfo.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace TestFtpServer.Shell
9 | {
10 | ///
11 | /// Interface for an executable command.
12 | ///
13 | public interface IExecutableCommandInfo : ICommandInfo
14 | {
15 | ///
16 | /// Execute the action.
17 | ///
18 | ///
19 | ///
20 | Task ExecuteAsync(CancellationToken cancellationToken);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/samples/TestFtpServer.Shell/IRootCommandInfo.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Shell
6 | {
7 | ///
8 | /// Root command information.
9 | ///
10 | public interface IRootCommandInfo : ICommandInfo
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/TestFtpServer.Shell/IShellStatus.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace TestFtpServer.Shell
8 | {
9 | ///
10 | /// Status of the FTP server shell.
11 | ///
12 | public interface IShellStatus
13 | {
14 | ///
15 | /// Gets or sets the simple module information names.
16 | ///
17 | ICollection SimpleModuleInfoNames { get; }
18 |
19 | ///
20 | /// Gets or sets the extended module information names.
21 | ///
22 | ICollection ExtendedModuleInfoName { get; }
23 |
24 | ///
25 | /// Gets or sets a value indicating whether the FTP server should be closed.
26 | ///
27 | bool Closed { get; set; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/samples/TestFtpServer.Shell/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemAmazonS3Options.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Options for the S3 file system.
9 | ///
10 | public class FileSystemAmazonS3Options
11 | {
12 | ///
13 | /// Gets or sets the AWS access key.
14 | ///
15 | public string? AwsAccessKeyId { get; set; }
16 |
17 | ///
18 | /// Gets or sets the AWS secret key.
19 | ///
20 | public string? AwsSecretAccessKey { get; set; }
21 |
22 | ///
23 | /// Gets or sets the S3 bucket region.
24 | ///
25 | ///
26 | /// It may be a region identifier like us-west-1.
27 | ///
28 | public string? BucketRegion { get; set; }
29 |
30 | ///
31 | /// Gets or sets the S3 bucket name.
32 | ///
33 | public string? BucketName { get; set; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemGoogleDriveOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Common Google Drive options.
9 | ///
10 | public class FileSystemGoogleDriveOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether background upload should be used.
14 | ///
15 | public bool BackgroundUpload { get; set; }
16 |
17 | ///
18 | /// Gets or sets options for a Google Drive from a user.
19 | ///
20 | public FileSystemGoogleDriveUserOptions User { get; set; } = new FileSystemGoogleDriveUserOptions();
21 |
22 | ///
23 | /// Gets or sets options for a Google Drive for a service.
24 | ///
25 | public FileSystemGoogleDriveServiceOptions Service { get; set; } = new FileSystemGoogleDriveServiceOptions();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemGoogleDriveServiceOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Options for a Google Drive for a service.
9 | ///
10 | public class FileSystemGoogleDriveServiceOptions
11 | {
12 | ///
13 | /// Gets or sets the path to the credential file.
14 | ///
15 | public string? CredentialFile { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemGoogleDriveUserOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Options for a Google Drive for a user.
9 | ///
10 | public class FileSystemGoogleDriveUserOptions
11 | {
12 | ///
13 | /// Gets or sets the path to the client secrets file.
14 | ///
15 | public string? ClientSecrets { get; set; }
16 |
17 | ///
18 | /// Gets or sets the user name.
19 | ///
20 | public string? UserName { get; set; }
21 |
22 | ///
23 | /// Gets or sets a value indicating whether the Google Drive access token should be refreshed.
24 | ///
25 | public bool RefreshToken { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemInMemoryOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Options for the in-memory file system.
9 | ///
10 | public class FileSystemInMemoryOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether the in-memory file system should be kept between two connects.
14 | ///
15 | public bool KeepAnonymous { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemLayoutType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// The file system layout.
9 | ///
10 | public enum FileSystemLayoutType
11 | {
12 | ///
13 | /// A single root for all users.
14 | ///
15 | SingleRoot,
16 |
17 | ///
18 | /// A root per-user relative to the specified file system root directory.
19 | ///
20 | RootPerUser,
21 |
22 | ///
23 | /// A single root for all users with the current directory set to the users home directory.
24 | ///
25 | PamHome,
26 |
27 | ///
28 | /// Users home directory as root.
29 | ///
30 | PamHomeChroot,
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemSystemIoOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO;
6 |
7 | namespace TestFtpServer.Configuration
8 | {
9 | ///
10 | /// System.IO based file system options.
11 | ///
12 | public class FileSystemSystemIoOptions
13 | {
14 | ///
15 | /// Gets or sets the root path.
16 | ///
17 | public string Root { get; set; } = Path.GetTempPath();
18 |
19 | ///
20 | /// Gets or sets a value indicating whether the content should be flushed to disk after every write operation.
21 | ///
22 | public bool FlushAfterWrite { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// The file system to use.
9 | ///
10 | public enum FileSystemType
11 | {
12 | ///
13 | /// The System.IO based file system.
14 | ///
15 | SystemIO,
16 |
17 | ///
18 | /// A file system that uses the native Linux API.
19 | ///
20 | Unix,
21 |
22 | ///
23 | /// In-Memory file system.
24 | ///
25 | InMemory,
26 |
27 | ///
28 | /// Google Drive for a user.
29 | ///
30 | GoogleDriveUser,
31 |
32 | ///
33 | /// Google Drive for a service.
34 | ///
35 | GoogleDriveService,
36 |
37 | ///
38 | /// Amazon S3 file system.
39 | ///
40 | AmazonS3,
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FileSystemUnixOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Unix file system options.
9 | ///
10 | public class FileSystemUnixOptions
11 | {
12 | ///
13 | /// Gets or sets the root directory.
14 | ///
15 | public string Root { get; set; } = "/";
16 |
17 | ///
18 | /// Gets or sets a value indicating whether the content should be flushed to disk after every write operation.
19 | ///
20 | public bool FlushAfterWrite { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FtpConnectionIdleCheckInactivityOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Options for manual idle checks for connections with an inactivity timeout.
9 | ///
10 | public class FtpConnectionIdleCheckInactivityOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether this check is enabled.
14 | ///
15 | public bool Enabled { get; set; } = true;
16 |
17 | ///
18 | /// Gets or sets the timeout for inactive connections.
19 | ///
20 | public int? InactivityTimeout { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FtpConnectionIdleCheckOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Options for idle checks for connections.
9 | ///
10 | public class FtpConnectionIdleCheckOptions
11 | {
12 | ///
13 | /// Configuration for idle-by-inactivity check.
14 | ///
15 | public FtpConnectionIdleCheckInactivityOptions Inactivity { get; set; } = new FtpConnectionIdleCheckInactivityOptions();
16 |
17 | ///
18 | /// Configuration for idly-by-unusable-socket check.
19 | ///
20 | public FtpConnectionIdleCheckSocketStateOptions SocketState { get; set; } = new FtpConnectionIdleCheckSocketStateOptions();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FtpConnectionIdleCheckSocketStateOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Configures the check that tests if a socket is usable.
9 | ///
10 | public class FtpConnectionIdleCheckSocketStateOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether this check is enabled.
14 | ///
15 | public bool Enabled { get; set; } = true;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/FtpServerPasvOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// The options for PASV/EPSV.
9 | ///
10 | public class FtpServerPasvOptions
11 | {
12 | ///
13 | /// Gets or sets the port range.
14 | ///
15 | public string? Range { get; set; }
16 |
17 | ///
18 | /// Gets or sets a value indicating whether promiscuous PASV is allowed.
19 | ///
20 | public bool Promiscuous { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/MembershipProviderType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace TestFtpServer.Configuration
8 | {
9 | ///
10 | /// The selected membership provider.
11 | ///
12 | [Flags]
13 | public enum MembershipProviderType
14 | {
15 | ///
16 | /// Use the default membership provider ().
17 | ///
18 | Default = 0,
19 |
20 | ///
21 | /// Use the custom (example) membership provider.
22 | ///
23 | Custom = 1,
24 |
25 | ///
26 | /// Use the membership provider for anonymous users.
27 | ///
28 | Anonymous = 2,
29 |
30 | ///
31 | /// Use the PAM membership provider.
32 | ///
33 | PAM = 4,
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Configuration/PamAuthOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.Configuration
6 | {
7 | ///
8 | /// Options for the PAM membership provider.
9 | ///
10 | public class PamAuthOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether PAM account management should not be used.
14 | ///
15 | ///
16 | /// This is only needed for WSL.
17 | ///
18 | public bool NoAccountManagement { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "TestFtpServer": {
4 | "commandName": "Project",
5 | "environmentVariables": {
6 | "FTPSERVER_ENVIRONMENT": "Development"
7 | }
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/samples/TestFtpServer/ServerInfo/IExtendedModuleInfo.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace TestFtpServer.ServerInfo
8 | {
9 | ///
10 | /// Extended module information.
11 | ///
12 | public interface IExtendedModuleInfo : IModuleInfo
13 | {
14 | ///
15 | /// Gets the extended information.
16 | ///
17 | /// The lines to be printed.
18 | IEnumerable GetExtendedInfo();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/ServerInfo/IModuleInfo.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace TestFtpServer.ServerInfo
6 | {
7 | ///
8 | /// Module information.
9 | ///
10 | public interface IModuleInfo
11 | {
12 | ///
13 | /// Gets the name of the module.
14 | ///
15 | string Name { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/samples/TestFtpServer/ServerInfo/ISimpleModuleInfo.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace TestFtpServer.ServerInfo
8 | {
9 | ///
10 | /// Simple module information.
11 | ///
12 | public interface ISimpleModuleInfo : IModuleInfo
13 | {
14 | ///
15 | /// Gets labels and values to be printed.
16 | ///
17 | ///
18 | IEnumerable<(string label, string value)> GetInfo();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/Anonymous/BlockAnonymousValidation.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.AccountManagement.Anonymous
9 | {
10 | ///
11 | /// Disallow anonymous logins.
12 | ///
13 | public class BlockAnonymousValidation : IAnonymousPasswordValidator
14 | {
15 | ///
16 | public bool IsValid(string password)
17 | {
18 | return false;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/Anonymous/IAnonymousPasswordValidator.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.AccountManagement.Anonymous
9 | {
10 | ///
11 | /// This interface validates the password for an anonymous login.
12 | ///
13 | public interface IAnonymousPasswordValidator
14 | {
15 | ///
16 | /// Determines whether this password is valid for an anonymous login.
17 | ///
18 | /// The password to validate.
19 | /// true
when the password is valid for this kind of anonymous authentication.
20 | bool IsValid(string password);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/Anonymous/NoValidation.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.AccountManagement.Anonymous
9 | {
10 | ///
11 | /// Performs no validation. Every kind of password is allowed.
12 | ///
13 | public class NoValidation : IAnonymousPasswordValidator
14 | {
15 | ///
16 | public bool IsValid(string password)
17 | {
18 | if (password.IndexOfAny(new[] { '/', '\\' }) != -1)
19 | {
20 | return false;
21 | }
22 |
23 | return true;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/Directories/SingleRootWithoutHome/SingleRootWithoutHomeAccountDirectoryQueryOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.AccountManagement.Directories.SingleRootWithoutHome
6 | {
7 | ///
8 | /// Options for the .
9 | ///
10 | public class SingleRootWithoutHomeAccountDirectoryQueryOptions
11 | {
12 | ///
13 | /// Gets or sets the root path.
14 | ///
15 | public string? RootPath { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/FtpClaimTypes.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.AccountManagement
6 | {
7 | ///
8 | /// Claim types for the FTP server.
9 | ///
10 | public static class FtpClaimTypes
11 | {
12 | ///
13 | /// The URI for a claim that specifies the users home path.
14 | ///
15 | public static readonly string HomePath = "http://schemas.fubar-dev.com/ws/2019/07/identity/claims/homepath";
16 |
17 | ///
18 | /// The URI for a claim that specifies the users Unix ID.
19 | ///
20 | public static readonly string UserId = "http://schemas.fubar-dev.com/ws/2019/07/identity/claims/user-id";
21 |
22 | ///
23 | /// The URI for a claim that specifies the users Unix main group ID.
24 | ///
25 | public static readonly string GroupId = "http://schemas.fubar-dev.com/ws/2019/07/identity/claims/group-id";
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/IAnonymousFtpUser.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace FubarDev.FtpServer.AccountManagement
8 | {
9 | ///
10 | /// The anonymous FTP interface.
11 | ///
12 | ///
13 | /// The password is interpreted as e-mail.
14 | ///
15 | [Obsolete("Use ClaimsPrincipal")]
16 | public interface IAnonymousFtpUser : IFtpUser
17 | {
18 | ///
19 | /// Gets the e-mail of the anonymous user which was given as password.
20 | ///
21 | string? Email { get; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/IFtpUser.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace FubarDev.FtpServer.AccountManagement
8 | {
9 | ///
10 | /// A basic FTP user interface.
11 | ///
12 | [Obsolete("Use ClaimsPrincipal")]
13 | public interface IFtpUser
14 | {
15 | ///
16 | /// Gets the name of the user.
17 | ///
18 | string Name { get; }
19 |
20 | ///
21 | /// Returns true when the user is in the given group.
22 | ///
23 | /// The name of the group.
24 | /// true when the user is in the queries .
25 | bool IsInGroup(string groupName);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/AccountManagement/IUnixUser.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace FubarDev.FtpServer.AccountManagement
8 | {
9 | ///
10 | /// Interface for unix user specific information.
11 | ///
12 | [Obsolete("Use ClaimsPrincipal")]
13 | public interface IUnixUser : IFtpUser
14 | {
15 | ///
16 | /// Gets the home path.
17 | ///
18 | string? HomePath { get; }
19 |
20 | ///
21 | /// Gets the user identifier.
22 | ///
23 | long UserId { get; }
24 |
25 | ///
26 | /// Gets the group identifier.
27 | ///
28 | long GroupId { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Authorization/Actions/SetHomeDirectoryActionOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Authorization.Actions
6 | {
7 | ///
8 | /// Options for the .
9 | ///
10 | public class SetHomeDirectoryActionOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether missing home directories should be created.
14 | ///
15 | public bool CreateMissingDirectories { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/BackgroundTransfer/BackgroundTransferStatus.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.BackgroundTransfer
9 | {
10 | ///
11 | /// The status of a single .
12 | ///
13 | public enum BackgroundTransferStatus
14 | {
15 | ///
16 | /// Added to transfer queue.
17 | ///
18 | Enqueued,
19 |
20 | ///
21 | /// Transferring the data.
22 | ///
23 | Transferring,
24 |
25 | ///
26 | /// Transfer finished.
27 | ///
28 | Finished,
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/BackgroundTransfer/ITemporaryData.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | using System;
9 | using System.IO;
10 | using System.Threading.Tasks;
11 |
12 | namespace FubarDev.FtpServer.BackgroundTransfer
13 | {
14 | ///
15 | /// Temporary data holder.
16 | ///
17 | ///
18 | /// Temporary data gets removed from the system when it's disposed.
19 | ///
20 | public interface ITemporaryData : IDisposable
21 | {
22 | ///
23 | /// Gets the size of the temporary data.
24 | ///
25 | long Size { get; }
26 |
27 | ///
28 | /// Opens the temporary data and returns a stream.
29 | ///
30 | /// The stream containig the temporary data.
31 | Task OpenAsync();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/BackgroundTransfer/ITemporaryDataFactory.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace FubarDev.FtpServer.BackgroundTransfer
10 | {
11 | ///
12 | /// Factory for temporary data objects.
13 | ///
14 | public interface ITemporaryDataFactory
15 | {
16 | ///
17 | /// Creates a temporary data object for data with the expected size.
18 | ///
19 | /// The stream containing the data.
20 | /// The expected data size.
21 | /// The cancellation token.
22 | /// The created temporary data object.
23 | Task CreateAsync(Stream input, long? expectedSize, CancellationToken cancellationToken);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ClaimsIdentityExtensions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Security.Claims;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// Extension methods for .
11 | ///
12 | public static class ClaimsIdentityExtensions
13 | {
14 | ///
15 | /// Checks if the identity represents an anonymous user.
16 | ///
17 | /// The identity to check.
18 | /// when identity is an anonymous user.
19 | public static bool IsAnonymous(this ClaimsIdentity identity)
20 | {
21 | return identity.HasClaim(c => c.Type == ClaimTypes.Anonymous);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/CloseEncryptedStreamDelegate.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Closes an encrypted stream.
12 | ///
13 | /// The cancellation token.
14 | /// The task.
15 | public delegate Task CloseEncryptedStreamDelegate(CancellationToken cancellationToken);
16 | }
17 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/CommandExtensions/IFtpCommandHandlerExtensionInformation.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | using FubarDev.FtpServer.Commands;
8 |
9 | namespace FubarDev.FtpServer.CommandExtensions
10 | {
11 | ///
12 | /// Interface for an FTP command handler extension.
13 | ///
14 | public interface IFtpCommandHandlerExtensionInformation : IFtpCommandInformation
15 | {
16 | ///
17 | /// Gets the type of the FTP command handler.
18 | ///
19 | Type Type { get; }
20 |
21 | ///
22 | /// Gets the FTP command handler that this one is an extension of.
23 | ///
24 | IFtpCommandHandlerInformation ExtensionOf { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/CommandExtensions/IFtpCommandHandlerExtensionProvider.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace FubarDev.FtpServer.CommandExtensions
8 | {
9 | ///
10 | /// Provides information about all found FTP command handler extensions.
11 | ///
12 | public interface IFtpCommandHandlerExtensionProvider
13 | {
14 | ///
15 | /// Gets the information for all command handler extensions.
16 | ///
17 | IEnumerable CommandHandlerExtensions { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/CommandExtensions/IFtpCommandHandlerExtensionScanner.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace FubarDev.FtpServer.CommandExtensions
8 | {
9 | ///
10 | /// Searches for FTP command handler extensions and returns information about it.
11 | ///
12 | public interface IFtpCommandHandlerExtensionScanner
13 | {
14 | ///
15 | /// Search for FTP command handler extensions.
16 | ///
17 | /// The information about the found FTP command handler extensions.
18 | IEnumerable Search();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/FtpCommandExecutionDelegate.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading.Tasks;
6 |
7 | namespace FubarDev.FtpServer.Commands
8 | {
9 | ///
10 | /// The delegate for the next middleware for the current FTP command execution step.
11 | ///
12 | /// The context of the current FTP command.
13 | /// The task.
14 | public delegate Task FtpCommandExecutionDelegate(FtpExecutionContext context);
15 | }
16 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFeatureInfoProvider.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace FubarDev.FtpServer.Commands
8 | {
9 | ///
10 | /// Provides feature information.
11 | ///
12 | public interface IFeatureInfoProvider
13 | {
14 | ///
15 | /// Get all feature information items that can be found in the system.
16 | ///
17 | /// The feature information items.
18 | IEnumerable GetFeatureInfoItems();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandActivator.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Commands
6 | {
7 | ///
8 | /// Activator for an FTP command.
9 | ///
10 | public interface IFtpCommandActivator
11 | {
12 | ///
13 | /// Gets information about the FTP command to be executed.
14 | ///
15 | /// The FTP command execution context.
16 | /// Information about the FTP command to be executed.
17 | FtpCommandSelection? Create(FtpCommandHandlerContext context);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandDispatcher.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer.Commands
9 | {
10 | ///
11 | /// Interface for a FTP command dispatcher.
12 | ///
13 | public interface IFtpCommandDispatcher
14 | {
15 | ///
16 | /// Passes the FTP commands to the handlers.
17 | ///
18 | /// The context for the FTP command execution.
19 | /// The cancellation token.
20 | /// The task.
21 | Task DispatchAsync(FtpContext context, CancellationToken cancellationToken);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandHandlerInformation.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace FubarDev.FtpServer.Commands
8 | {
9 | ///
10 | /// Information about an FTP command handler.
11 | ///
12 | public interface IFtpCommandHandlerInformation : IFtpCommandInformation
13 | {
14 | ///
15 | /// Gets the type of the FTP command handler.
16 | ///
17 | Type Type { get; }
18 |
19 | ///
20 | /// Gets a value indicating whether this command is extensible.
21 | ///
22 | bool IsExtensible { get; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandHandlerInstanceInformation.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace FubarDev.FtpServer.Commands
8 | {
9 | ///
10 | /// Interface to get the instance for a command handler created through dependency injection.
11 | ///
12 | [Obsolete]
13 | public interface IFtpCommandHandlerInstanceInformation : IFtpCommandHandlerInformation
14 | {
15 | ///
16 | /// Gets the FTP command handler instance.
17 | ///
18 | IFtpCommandHandler Instance { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandHandlerProvider.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace FubarDev.FtpServer.Commands
8 | {
9 | ///
10 | /// Provides information about all found FTP command handlers.
11 | ///
12 | public interface IFtpCommandHandlerProvider
13 | {
14 | ///
15 | /// Gets the information for all command handlers.
16 | ///
17 | IEnumerable CommandHandlers { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandHandlerScanner.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace FubarDev.FtpServer.Commands
8 | {
9 | ///
10 | /// Searches for FTP command handlers and returns information about it.
11 | ///
12 | public interface IFtpCommandHandlerScanner
13 | {
14 | ///
15 | /// Search for FTP command handlers.
16 | ///
17 | /// The information about the found FTP command handlers.
18 | IEnumerable Search();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandInformation.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Commands
6 | {
7 | ///
8 | /// Generic information about an FTP command.
9 | ///
10 | public interface IFtpCommandInformation
11 | {
12 | ///
13 | /// Gets the name of the FTP command.
14 | ///
15 | string Name { get; }
16 |
17 | ///
18 | /// Gets a value indicating whether a login is required to execute this command.
19 | ///
20 | bool IsLoginRequired { get; }
21 |
22 | ///
23 | /// Gets a value indicating whether this command is abortable.
24 | ///
25 | bool IsAbortable { get; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Commands/IFtpCommandMiddleware.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading.Tasks;
6 |
7 | namespace FubarDev.FtpServer.Commands
8 | {
9 | ///
10 | /// FTP command middleware.
11 | ///
12 | public interface IFtpCommandMiddleware
13 | {
14 | ///
15 | /// Function that gets invoked for the middleware.
16 | ///
17 | /// The context for the current FTP command.
18 | /// The next middleware.
19 | /// The task.
20 | Task InvokeAsync(
21 | FtpExecutionContext context,
22 | FtpCommandExecutionDelegate next);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ConnectionChecks/FtpConnectionCheckContext.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ConnectionChecks
6 | {
7 | ///
8 | /// The context of the FTP connection check.
9 | ///
10 | public class FtpConnectionCheckContext
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The FTP connection.
16 | public FtpConnectionCheckContext(IFtpConnection connection)
17 | {
18 | Connection = connection;
19 | }
20 |
21 | ///
22 | /// Gets the FTP connection.
23 | ///
24 | public IFtpConnection Connection { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ConnectionChecks/FtpConnectionCheckResult.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ConnectionChecks
6 | {
7 | ///
8 | /// Result object for a connection usability check.
9 | ///
10 | public sealed class FtpConnectionCheckResult
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// A value indicating whether the connection is usable.
16 | public FtpConnectionCheckResult(bool isUsable)
17 | {
18 | IsUsable = isUsable;
19 | }
20 |
21 | ///
22 | /// Gets a value indicating whether the connection is usable.
23 | ///
24 | public bool IsUsable { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ConnectionChecks/IFtpConnectionCheck.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ConnectionChecks
6 | {
7 | ///
8 | /// Check if the connection is usable/connected/not idle.
9 | ///
10 | public interface IFtpConnectionCheck
11 | {
12 | ///
13 | /// Check if the connection is usable.
14 | ///
15 | /// The FTP connection check context.
16 | /// that contains the result of the check.
17 | FtpConnectionCheckResult Check(FtpConnectionCheckContext context);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ConnectionChecks/IFtpConnectionStatusCheck.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ConnectionChecks
6 | {
7 | ///
8 | /// Interface to check if the connection is still alive and kicking.
9 | ///
10 | public interface IFtpConnectionStatusCheck
11 | {
12 | ///
13 | /// Check if the connection is still alive.
14 | ///
15 | /// when the connection is still alive.
16 | bool CheckIfAlive();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ConnectionInitAsyncDelegate.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Async delegate to initialize a connection.
12 | ///
13 | /// The connection to initialize.
14 | /// The cancellation token.
15 | /// The task for the asynchronous operation.
16 | public delegate Task ConnectionInitAsyncDelegate(IFtpConnection connection, CancellationToken cancellationToken);
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ConnectionStatus.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// The status of the current connection.
9 | ///
10 | public enum ConnectionStatus
11 | {
12 | ///
13 | /// The initial status.
14 | ///
15 | Begin,
16 |
17 | ///
18 | /// Executing login.
19 | ///
20 | Login,
21 |
22 | ///
23 | /// User is authorized.
24 | ///
25 | Authorized,
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/CreateEncryptedStreamDelegate.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// A delegate that's used to create an encrypted stream ().
12 | ///
13 | /// The unencrypted stream.
14 | /// The encrypted stream.
15 | public delegate Task CreateEncryptedStreamDelegate(Stream unencryptedStream);
16 | }
17 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Events/FtpConnectionCommandReceivedEvent.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Events
6 | {
7 | ///
8 | /// This event object gets sent when a command was received.
9 | ///
10 | public class FtpConnectionCommandReceivedEvent : IFtpConnectionEvent
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The received FTP command.
16 | public FtpConnectionCommandReceivedEvent(FtpCommand command)
17 | {
18 | Command = command;
19 | }
20 |
21 | ///
22 | /// Gets the received FTP command.
23 | ///
24 | public FtpCommand Command { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Events/FtpConnectionDataTransferStoppedEvent.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Events
6 | {
7 | ///
8 | /// This event object gets sent when a data transfer was stopped.
9 | ///
10 | public class FtpConnectionDataTransferStoppedEvent : IFtpConnectionEvent
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The transfer ID.
16 | public FtpConnectionDataTransferStoppedEvent(string transferId)
17 | {
18 | TransferId = transferId;
19 | }
20 |
21 | ///
22 | /// Gets the transfer ID.
23 | ///
24 | public string TransferId { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Events/IFtpConnectionEvent.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Events
6 | {
7 | ///
8 | /// Base interface for an FTP connection event.
9 | ///
10 | public interface IFtpConnectionEvent
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Events/IFtpConnectionEventHost.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Events
6 | {
7 | ///
8 | /// The event host.
9 | ///
10 | public interface IFtpConnectionEventHost
11 | {
12 | ///
13 | /// Publish the event.
14 | ///
15 | /// The event to publish.
16 | void PublishEvent(IFtpConnectionEvent evt);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IAuthorizationInformationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Security.Claims;
7 |
8 | using FubarDev.FtpServer.AccountManagement;
9 |
10 | namespace FubarDev.FtpServer.Features
11 | {
12 | ///
13 | /// Authorization information feature.
14 | ///
15 | public interface IAuthorizationInformationFeature
16 | {
17 | ///
18 | /// Gets or sets the current user.
19 | ///
20 | [Obsolete("Use the FtpUser property.")]
21 | IFtpUser? User { get; set; }
22 |
23 | ///
24 | /// Gets or sets the current user.
25 | ///
26 | ClaimsPrincipal? FtpUser { get; set; }
27 |
28 | ///
29 | /// Gets or sets the membership provider that authenticated the .
30 | ///
31 | IMembershipProvider? MembershipProvider { get; set; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IBackgroundTaskLifetimeFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading.Tasks;
6 |
7 | namespace FubarDev.FtpServer.Features
8 | {
9 | ///
10 | /// Feature for background tasks (abortable commands).
11 | ///
12 | public interface IBackgroundTaskLifetimeFeature
13 | {
14 | ///
15 | /// Gets the command that gets run in the background.
16 | ///
17 | FtpCommand Command { get; }
18 |
19 | ///
20 | /// Gets the FTP command handler.
21 | ///
22 | IFtpCommandBase Handler { get; }
23 |
24 | ///
25 | /// Gets the abortable task.
26 | ///
27 | Task Task { get; }
28 |
29 | ///
30 | /// Aborts the command that is run in the background.
31 | ///
32 | void Abort();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IConnectionFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Net;
7 |
8 | namespace FubarDev.FtpServer.Features
9 | {
10 | ///
11 | /// Information about the current connection.
12 | ///
13 | public interface IConnectionFeature
14 | {
15 | ///
16 | /// Gets the local end point.
17 | ///
18 | IPEndPoint LocalEndPoint { get; }
19 |
20 | ///
21 | /// Gets the remote end point.
22 | ///
23 | IPEndPoint RemoteEndPoint { get; }
24 |
25 | ///
26 | /// Gets the remote address of the client.
27 | ///
28 | [Obsolete]
29 | Address RemoteAddress { get; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IEncodingFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Text;
6 |
7 | namespace FubarDev.FtpServer.Features
8 | {
9 | ///
10 | /// Encoding of commands, paths and/or names.
11 | ///
12 | public interface IEncodingFeature
13 | {
14 | ///
15 | /// Gets the default encoding.
16 | ///
17 | Encoding DefaultEncoding { get; }
18 |
19 | ///
20 | /// Gets or sets the encoding for commands and paths.
21 | ///
22 | Encoding Encoding { get; set; }
23 |
24 | ///
25 | /// Gets or sets the for the NLST command.
26 | ///
27 | Encoding NlstEncoding { get; set; }
28 |
29 | ///
30 | /// Reset all encodings to the default encoding.
31 | ///
32 | void Reset();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IFileSystemFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | using FubarDev.FtpServer.FileSystem;
8 |
9 | namespace FubarDev.FtpServer.Features
10 | {
11 | ///
12 | /// File system feature.
13 | ///
14 | public interface IFileSystemFeature
15 | {
16 | ///
17 | /// Gets or sets the to use for the user.
18 | ///
19 | IUnixFileSystem FileSystem { get; set; }
20 |
21 | ///
22 | /// Gets or sets the current path into the .
23 | ///
24 | Stack Path { get; set; }
25 |
26 | ///
27 | /// Gets the current of the current .
28 | ///
29 | IUnixDirectoryEntry CurrentDirectory { get; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/ILocalizationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Globalization;
6 |
7 | using FubarDev.FtpServer.Localization;
8 |
9 | namespace FubarDev.FtpServer.Features
10 | {
11 | ///
12 | /// Localization feature.
13 | ///
14 | public interface ILocalizationFeature
15 | {
16 | ///
17 | /// Gets or sets the selected language.
18 | ///
19 | CultureInfo Language { get; set; }
20 |
21 | ///
22 | /// Gets or sets the catalog to be used by the default FTP server implementation.
23 | ///
24 | ILocalizationCatalog Catalog { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IMlstFactsFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | using FubarDev.FtpServer.ListFormatters.Facts;
8 |
9 | namespace FubarDev.FtpServer.Features
10 | {
11 | ///
12 | /// Active facts sent by MLST and MLSD.
13 | ///
14 | public interface IMlstFactsFeature
15 | {
16 | ///
17 | /// Gets the active sent by MLST and MLSD.
18 | ///
19 | ISet ActiveMlstFacts { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IRenameCommandFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using FubarDev.FtpServer.FileSystem;
6 |
7 | namespace FubarDev.FtpServer.Features
8 | {
9 | ///
10 | /// Feature for the RNFR and RNTO commands.
11 | ///
12 | public interface IRenameCommandFeature
13 | {
14 | ///
15 | /// Gets or sets the to use for a RNTO operation.
16 | ///
17 | SearchResult RenameFrom { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IRestCommandFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Features
6 | {
7 | ///
8 | /// Feature for the REST command.
9 | ///
10 | public interface IRestCommandFeature
11 | {
12 | ///
13 | /// Gets or sets the restart position for appending data to a file.
14 | ///
15 | long RestartPosition { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/IServerCommandFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading.Channels;
6 |
7 | using FubarDev.FtpServer.ServerCommands;
8 |
9 | namespace FubarDev.FtpServer.Features
10 | {
11 | ///
12 | /// The server command feature.
13 | ///
14 | public interface IServerCommandFeature
15 | {
16 | ///
17 | /// Gets the channel to write server commands.
18 | ///
19 | ChannelWriter ServerCommandWriter { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/ITransferConfigurationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Features
6 | {
7 | ///
8 | /// Feature for transfer commands.
9 | ///
10 | public interface ITransferConfigurationFeature
11 | {
12 | ///
13 | /// Gets or sets the .
14 | ///
15 | FtpTransferMode TransferMode { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/Impl/AuthorizationInformationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Security.Claims;
7 |
8 | using FubarDev.FtpServer.AccountManagement;
9 |
10 | namespace FubarDev.FtpServer.Features.Impl
11 | {
12 | ///
13 | /// Default implementation of .
14 | ///
15 | internal class AuthorizationInformationFeature : IAuthorizationInformationFeature
16 | {
17 | ///
18 | [Obsolete("Use the FtpUser property.")]
19 | public IFtpUser? User { get; set; }
20 |
21 | ///
22 | public ClaimsPrincipal? FtpUser { get; set; }
23 |
24 | ///
25 | public IMembershipProvider? MembershipProvider { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/Impl/LocalizationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Globalization;
6 |
7 | using FubarDev.FtpServer.Localization;
8 |
9 | namespace FubarDev.FtpServer.Features.Impl
10 | {
11 | ///
12 | /// The default implementation of the class.
13 | ///
14 | internal class LocalizationFeature : ILocalizationFeature
15 | {
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | /// The catalog loader.
20 | public LocalizationFeature(IFtpCatalogLoader catalogLoader)
21 | {
22 | Language = catalogLoader.DefaultLanguage;
23 | Catalog = catalogLoader.DefaultCatalog;
24 | }
25 |
26 | ///
27 | public CultureInfo Language { get; set; }
28 |
29 | ///
30 | public ILocalizationCatalog Catalog { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/Impl/ServerCommandFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading.Channels;
6 |
7 | using FubarDev.FtpServer.ServerCommands;
8 |
9 | namespace FubarDev.FtpServer.Features.Impl
10 | {
11 | ///
12 | /// Default implementation of the .
13 | ///
14 | public class ServerCommandFeature : IServerCommandFeature
15 | {
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | /// The channel for sending the server commands.
20 | public ServerCommandFeature(ChannelWriter serverCommandWriter)
21 | {
22 | ServerCommandWriter = serverCommandWriter;
23 | }
24 |
25 | ///
26 | public ChannelWriter ServerCommandWriter { get; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Features/Impl/TransferConfigurationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Features.Impl
6 | {
7 | ///
8 | /// Default implementation of .
9 | ///
10 | internal class TransferConfigurationFeature : ITransferConfigurationFeature
11 | {
12 | ///
13 | public FtpTransferMode TransferMode { get; set; } = new FtpTransferMode(FtpFileType.Ascii);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FileSystem/IAccessMode.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.FileSystem
9 | {
10 | ///
11 | /// A unix style access mode interface.
12 | ///
13 | public interface IAccessMode
14 | {
15 | ///
16 | /// Gets a value indicating whether a read is allowed.
17 | ///
18 | bool Read { get; }
19 |
20 | ///
21 | /// Gets a value indicating whether a write is allowed.
22 | ///
23 | bool Write { get; }
24 |
25 | ///
26 | /// Gets a value indicating whether an execute is allowed.
27 | ///
28 | bool Execute { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FileSystem/IAccountDirectories.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.FileSystem
6 | {
7 | ///
8 | /// Well-known directories for a given account.
9 | ///
10 | public interface IAccountDirectories
11 | {
12 | ///
13 | /// Gets the FTP root path.
14 | ///
15 | ///
16 | /// The root path is always relative to the file system root path.
17 | /// If this path is not set, the file systems root directory will be used.
18 | ///
19 | string? RootPath { get; }
20 |
21 | ///
22 | /// Gets the initial path for the account.
23 | ///
24 | ///
25 | /// This path is always relative to the root path above.
26 | /// / will be used if the
27 | /// is not set.
28 | ///
29 | string? HomePath { get; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FileSystem/IAccountDirectoryQuery.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.FileSystem
6 | {
7 | ///
8 | /// Queries directories for a given account.
9 | ///
10 | public interface IAccountDirectoryQuery
11 | {
12 | ///
13 | /// Get the account directories from the account information.
14 | ///
15 | /// The account to get the directories from.
16 | /// The directories for the account.
17 | IAccountDirectories GetDirectories(IAccountInformation accountInformation);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FileSystem/IUnixDirectoryEntry.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.FileSystem
9 | {
10 | ///
11 | /// A unix directory entry.
12 | ///
13 | public interface IUnixDirectoryEntry : IUnixFileSystemEntry
14 | {
15 | ///
16 | /// Gets a value indicating whether this is the root directory.
17 | ///
18 | bool IsRoot { get; }
19 |
20 | ///
21 | /// Gets a value indicating whether this directory can be deleted.
22 | ///
23 | bool IsDeletable { get; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FileSystem/IUnixFileEntry.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.FileSystem
9 | {
10 | ///
11 | /// A unix file entry.
12 | ///
13 | public interface IUnixFileEntry : IUnixFileSystemEntry
14 | {
15 | ///
16 | /// Gets the size of the file.
17 | ///
18 | long Size { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FileSystem/IUnixOwner.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.FileSystem
6 | {
7 | ///
8 | /// Defines the owning user and group of an item.
9 | ///
10 | public interface IUnixOwner
11 | {
12 | ///
13 | /// Gets the owner.
14 | ///
15 | string Owner { get; }
16 |
17 | ///
18 | /// Gets the group.
19 | ///
20 | string Group { get; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FileSystem/IUnixPermissions.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer.FileSystem
9 | {
10 | ///
11 | /// Unix file system entry permissions.
12 | ///
13 | public interface IUnixPermissions
14 | {
15 | ///
16 | /// Gets the user permissions.
17 | ///
18 | IAccessMode User { get; }
19 |
20 | ///
21 | /// Gets the group permissions.
22 | ///
23 | IAccessMode Group { get; }
24 |
25 | ///
26 | /// Gets the other permissions.
27 | ///
28 | IAccessMode Other { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpCommandHandlerContext.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// The context in which an FTP command gets executed.
9 | ///
10 | public class FtpCommandHandlerContext
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The FTP context.
16 | public FtpCommandHandlerContext(FtpContext ftpContext)
17 | {
18 | FtpContext = ftpContext;
19 | }
20 |
21 | ///
22 | /// Gets the FTP context.
23 | ///
24 | public FtpContext FtpContext { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpConnectionContext.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using Microsoft.AspNetCore.Http.Features;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// The FTP connection context.
11 | ///
12 | public abstract class FtpConnectionContext
13 | {
14 | ///
15 | /// Gets or sets the connection identifier.
16 | ///
17 | public abstract string ConnectionId { get; set; }
18 |
19 | ///
20 | /// Gets the connection features.
21 | ///
22 | public abstract IFeatureCollection Features { get; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpFileType.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// FTP data type (3.1.1).
12 | ///
13 | public enum FtpFileType
14 | {
15 | ///
16 | /// ASCII data type (3.1.1.1.).
17 | ///
18 | Ascii,
19 |
20 | ///
21 | /// EBCDIC data type (3.1.1.2.).
22 | ///
23 | Ebcdic,
24 |
25 | ///
26 | /// IMAGE data type (3.1.1.3.).
27 | ///
28 | Image,
29 |
30 | ///
31 | /// LOCAL data type (3.1.1.4.).
32 | ///
33 | Local,
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpFileTypeInterpreterMode.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Format control (RFC 959 chapter 3.1.1.5).
12 | ///
13 | public enum FtpFileTypeInterpreterMode
14 | {
15 | ///
16 | /// Default format (3.1.1.5.1).
17 | ///
18 | NonPrint,
19 |
20 | ///
21 | /// Telnet format controls (3.1.1.5.2).
22 | ///
23 | Telnet,
24 |
25 | ///
26 | /// Carriage Control (ASA, 3.1.1.5.3).
27 | ///
28 | AsaCarriageControl,
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpRequestDelegate.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading.Tasks;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// The delegate for the next middleware for the current request.
11 | ///
12 | /// The context of the current FTP command.
13 | /// The task.
14 | public delegate Task FtpRequestDelegate(FtpContext context);
15 | }
16 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpResponseAfterWriteDelegate.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace FubarDev.FtpServer
10 | {
11 | ///
12 | /// Delegate to be called after a response was written.
13 | ///
14 | /// The FTP connection.
15 | /// The cancellation token.
16 | /// The task.
17 | [Obsolete("Use a custom server command.")]
18 | public delegate Task FtpResponseAfterWriteAsyncDelegate(
19 | IFtpConnection connection,
20 | CancellationToken cancellationToken);
21 | }
22 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpResponseListStatus.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// The status for building a response list.
9 | ///
10 | internal enum FtpResponseListStatus
11 | {
12 | ///
13 | /// The next line to create is the start line.
14 | ///
15 | StartLine,
16 |
17 | ///
18 | /// The next line to be created is either a data line or end line.
19 | ///
20 | Between,
21 |
22 | ///
23 | /// The last line was created.
24 | ///
25 | Finished,
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/FtpServiceStatus.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// The current status of the .
9 | ///
10 | public enum FtpServiceStatus
11 | {
12 | ///
13 | /// The service is ready to run.
14 | ///
15 | ReadyToRun,
16 |
17 | ///
18 | /// The service was stopped.
19 | ///
20 | Stopped,
21 |
22 | ///
23 | /// The service was paused.
24 | ///
25 | Paused,
26 |
27 | ///
28 | /// The service is running.
29 | ///
30 | Running,
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IAccountInformation.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Security.Claims;
7 |
8 | using FubarDev.FtpServer.AccountManagement;
9 |
10 | namespace FubarDev.FtpServer
11 | {
12 | ///
13 | /// Information about the account associated to a connection.
14 | ///
15 | public interface IAccountInformation
16 | {
17 | ///
18 | /// Gets the current user.
19 | ///
20 | [Obsolete("Use FtpUser to get the user information.")]
21 | IFtpUser User { get; }
22 |
23 | ///
24 | /// Gets the current FTP user.
25 | ///
26 | ClaimsPrincipal FtpUser { get; }
27 |
28 | ///
29 | /// Gets the membership provider which authenticated the .
30 | ///
31 | IMembershipProvider MembershipProvider { get; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFeatureHost.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Collections.Generic;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Interface for something that may host FTP features.
12 | ///
13 | [Obsolete("FTP command handlers (and other types) are now annotated with attributes implementing IFeatureInfo.")]
14 | public interface IFeatureHost
15 | {
16 | ///
17 | /// Gets a collection of features supported by this command handler.
18 | ///
19 | /// The FTP connection.
20 | /// A list of features supported by this command handler.
21 | [Obsolete("FTP command handlers (and other types) are now annotated with attributes implementing IFeatureInfo.")]
22 | IEnumerable GetSupportedFeatures(IFtpConnection connection);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpConnectionAccessor.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// Accessor to get/set the current (scoped) FTP connection.
9 | ///
10 | public interface IFtpConnectionAccessor
11 | {
12 | ///
13 | /// Gets or sets the current FTP connection.
14 | ///
15 | IFtpConnection FtpConnection { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpConnectionConfigurator.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Interface for services that need to reconfigure the connection.
12 | ///
13 | public interface IFtpConnectionConfigurator
14 | {
15 | ///
16 | /// Changes the connections configuration.
17 | ///
18 | /// The FTP connection.
19 | /// The cancellation token.
20 | /// The task.
21 | Task Configure(IFtpConnection connection, CancellationToken cancellationToken);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpControlStreamAdapter.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace FubarDev.FtpServer
10 | {
11 | ///
12 | /// Adapter for the control stream.
13 | ///
14 | public interface IFtpControlStreamAdapter
15 | {
16 | ///
17 | /// Wraps the control stream.
18 | ///
19 | /// The stream to wrap.
20 | /// The cancellation token.
21 | /// The task returning the new stream.
22 | Task WrapAsync(Stream stream, CancellationToken cancellationToken);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpHostSelector.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Interface to select an FTP host or get the selected FTP host.
12 | ///
13 | public interface IFtpHostSelector
14 | {
15 | ///
16 | /// Gets the selected FTP host.
17 | ///
18 | IFtpHost SelectedHost { get; }
19 |
20 | ///
21 | /// Selects the new FTP host.
22 | ///
23 | /// The host to select.
24 | /// The cancellation token.
25 | /// The FTP response for the HOST command.
26 | Task SelectHostAsync(HostInfo hostInfo, CancellationToken cancellationToken);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpListenerService.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Net.Sockets;
7 | using System.Threading;
8 | using System.Threading.Channels;
9 |
10 | namespace FubarDev.FtpServer
11 | {
12 | ///
13 | /// Service to control the listener for FTP connections.
14 | ///
15 | public interface IFtpListenerService : IPausableFtpService
16 | {
17 | ///
18 | /// Event to be triggered when the listener started.
19 | ///
20 | event EventHandler? ListenerStarted;
21 |
22 | ///
23 | /// Gets the for the listener.
24 | ///
25 | CancellationTokenSource ListenerShutdown { get; }
26 |
27 | ///
28 | /// Gets the channel with new TCP clients.
29 | ///
30 | ChannelReader Channel { get; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpMiddleware.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading.Tasks;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// FTP middleware.
11 | ///
12 | public interface IFtpMiddleware
13 | {
14 | ///
15 | /// Function that gets invoked for the middleware.
16 | ///
17 | /// The context for the current FTP command.
18 | /// The next middleware.
19 | /// The task.
20 | Task InvokeAsync(FtpContext context, FtpRequestDelegate next);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpServerBuilder.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// Base interface for configuration.
11 | ///
12 | public interface IFtpServerBuilder
13 | {
14 | ///
15 | /// Gets the service collection.
16 | ///
17 | IServiceCollection Services { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpServerStatistics.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// Statistics about the FTP server.
9 | ///
10 | public interface IFtpServerStatistics
11 | {
12 | ///
13 | /// Gets the total number of connections.
14 | ///
15 | long TotalConnections { get; }
16 |
17 | ///
18 | /// Gets the currently active number of connections.
19 | ///
20 | long ActiveConnections { get; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IFtpService.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Defines methods for services required to run the FTP server.
12 | ///
13 | public interface IFtpService
14 | {
15 | ///
16 | /// Triggered when the application host is ready to start the service.
17 | ///
18 | /// Indicates that the start process has been aborted.
19 | /// The task.
20 | Task StartAsync(CancellationToken cancellationToken);
21 |
22 | ///
23 | /// Triggered when the application host is performing a graceful shutdown.
24 | ///
25 | /// Indicates that the shutdown process should no longer be graceful.
26 | /// The task.
27 | Task StopAsync(CancellationToken cancellationToken);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IListFormatter.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | using FubarDev.FtpServer.FileSystem;
9 |
10 | namespace FubarDev.FtpServer
11 | {
12 | ///
13 | /// Interface that provides the text to output for the LIST and NLST commands.
14 | ///
15 | public interface IListFormatter
16 | {
17 | ///
18 | /// Gets the output line to write for the given .
19 | ///
20 | /// The entry to create the output line for.
21 | /// The name of the entry (can be null if the original entry name should be used).
22 | /// The text to write to the client.
23 | string Format(IUnixFileSystemEntry entry, string? entryName = null);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/IPasvAddressResolver.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Net.Sockets;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace FubarDev.FtpServer
10 | {
11 | ///
12 | /// Interface to get the options for the PASV/EPSV commands.
13 | ///
14 | public interface IPasvAddressResolver
15 | {
16 | ///
17 | /// Get the PASV/EPSV options.
18 | ///
19 | /// The FTP connection.
20 | /// The address family for the address to be selected.
21 | /// The cancellation token.
22 | /// The task returning the options.
23 | Task GetOptionsAsync(
24 | IFtpConnection connection,
25 | AddressFamily? addressFamily,
26 | CancellationToken cancellationToken);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ListFormatters/Facts/CurrentDirectoryFact.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ListFormatters.Facts
6 | {
7 | ///
8 | /// The cdir fact.
9 | ///
10 | public class CurrentDirectoryFact : TypeFact
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | public CurrentDirectoryFact()
16 | : base("cdir")
17 | {
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ListFormatters/Facts/GenericFact.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ListFormatters.Facts
6 | {
7 | ///
8 | /// A generic fact to be used when no predefined exists.
9 | ///
10 | public class GenericFact : IFact
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The fact name.
16 | /// The fact value.
17 | public GenericFact(string name, string value)
18 | {
19 | Name = name;
20 | Value = value;
21 | }
22 |
23 | ///
24 | public string Name { get; }
25 |
26 | ///
27 | public string Value { get; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ListFormatters/Facts/IFact.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ListFormatters.Facts
6 | {
7 | ///
8 | /// The basic interface for a fact (MLST).
9 | ///
10 | public interface IFact
11 | {
12 | ///
13 | /// Gets the name of the fact.
14 | ///
15 | string Name { get; }
16 |
17 | ///
18 | /// Gets the value of the fact.
19 | ///
20 | string Value { get; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ListFormatters/Facts/ParentDirectoryFact.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ListFormatters.Facts
6 | {
7 | ///
8 | /// The pdir fact.
9 | ///
10 | public class ParentDirectoryFact : TypeFact
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | public ParentDirectoryFact()
16 | : base("pdir")
17 | {
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ListFormatters/Facts/SizeFact.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Globalization;
6 |
7 | namespace FubarDev.FtpServer.ListFormatters.Facts
8 | {
9 | ///
10 | /// The size fact.
11 | ///
12 | public class SizeFact : IFact
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | /// The file system entry size.
18 | public SizeFact(long size)
19 | {
20 | Value = size.ToString(CultureInfo.InvariantCulture);
21 | }
22 |
23 | ///
24 | public string Name => "size";
25 |
26 | ///
27 | public string Value { get; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ListFormatters/ShortListFormatter.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | using FubarDev.FtpServer.FileSystem;
9 |
10 | namespace FubarDev.FtpServer.ListFormatters
11 | {
12 | ///
13 | /// The for the short directory listing format (name only).
14 | ///
15 | public class ShortListFormatter : IListFormatter
16 | {
17 | ///
18 | public string Format(IUnixFileSystemEntry entry, string? name)
19 | {
20 | return name ?? entry.Name;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ListenerStartedEventArgs.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// Event arguments for a started listener.
11 | ///
12 | public class ListenerStartedEventArgs : EventArgs
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | /// The port used by the listener.
18 | public ListenerStartedEventArgs(int port)
19 | {
20 | Port = port;
21 | }
22 |
23 | ///
24 | /// Gets the port that's used by the listener.
25 | ///
26 | public int Port { get; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/Localization/ILocalizationCatalog.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Jan Klass. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Localization
6 | {
7 | public interface ILocalizationCatalog
8 | {
9 | /// Translate .
10 | /// The text to be translated.
11 | /// The translated text.
12 | string GetString(string text);
13 |
14 | /// Translate with format values .
15 | /// The text to be translated.
16 | /// The format arguments.
17 | /// The translated text.
18 | string GetString(string text, params object[] args);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ServerCommands/AsyncDataConnectionDelegate.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer.ServerCommands
9 | {
10 | ///
11 | /// Delegate for sending or receivung data over a data connection.
12 | ///
13 | /// The data connection used to send or receive the data over.
14 | /// The cancellation token to signal command abortion.
15 | /// The task with an FTP response if it should be different than the default one.
16 | public delegate Task AsyncDataConnectionDelegate(IFtpDataConnection dataConnection, CancellationToken cancellationToken);
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ServerCommands/CloseConnectionServerCommand.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ServerCommands
6 | {
7 | ///
8 | /// Command to close the connection.
9 | ///
10 | public class CloseConnectionServerCommand : IServerCommand
11 | {
12 | ///
13 | public override string ToString() => "CLOSE CONNECTION";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ServerCommands/CloseDataConnectionServerCommand.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ServerCommands
6 | {
7 | ///
8 | /// Command to close the data connection.
9 | ///
10 | public class CloseDataConnectionServerCommand : IServerCommand
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The data connection to be closed.
16 | public CloseDataConnectionServerCommand(IFtpDataConnection dataConnection)
17 | {
18 | DataConnection = dataConnection;
19 | }
20 |
21 | ///
22 | /// Gets the data connection to be closed.
23 | ///
24 | public IFtpDataConnection DataConnection { get; }
25 |
26 | ///
27 | public override string ToString() => "CLOSE DATA CONNECTION";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ServerCommands/IServerCommand.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ServerCommands
6 | {
7 | ///
8 | /// Base interface for all server commands.
9 | ///
10 | public interface IServerCommand
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Abstractions/ServerCommands/IServerCommandHandler{TCommand}.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer.ServerCommands
9 | {
10 | ///
11 | /// Interface to be implemented by a server command handler.
12 | ///
13 | /// The server command type.
14 | // ReSharper disable once TypeParameterCanBeVariant
15 | public interface IServerCommandHandler
16 | where TCommand : class, IServerCommand
17 | {
18 | ///
19 | /// Executes the server command.
20 | ///
21 | /// The command to execute.
22 | /// The cancellation token.
23 | /// The task.
24 | Task ExecuteAsync(TCommand command, CancellationToken cancellationToken);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/CommandHandlers/AcctCommandHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | using FubarDev.FtpServer.Commands;
9 |
10 | using Microsoft.Extensions.DependencyInjection;
11 |
12 | namespace FubarDev.FtpServer.CommandHandlers
13 | {
14 | ///
15 | /// Implements the ACCT command.
16 | ///
17 | [FtpCommandHandler("ACCT", isLoginRequired: false)]
18 | public class AcctCommandHandler : FtpCommandHandler
19 | {
20 | ///
21 | public override Task Process(FtpCommand command, CancellationToken cancellationToken)
22 | {
23 | var loginStateMachine = Connection.ConnectionServices.GetRequiredService();
24 | return loginStateMachine.ExecuteAsync(command, cancellationToken);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/CommandHandlers/AlloCommandHandler.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 |
11 | using FubarDev.FtpServer.Commands;
12 |
13 | namespace FubarDev.FtpServer.CommandHandlers
14 | {
15 | ///
16 | /// Implements the ALLO command.
17 | ///
18 | [FtpCommandHandler("ALLO", isLoginRequired: false)]
19 | public class AlloCommandHandler : FtpCommandHandler
20 | {
21 | ///
22 | public override Task Process(FtpCommand command, CancellationToken cancellationToken)
23 | {
24 | return Task.FromResult(new FtpResponse(202, T("Allo processed successfully (deprecated).")));
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/CommandHandlers/AuthCommandHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | using FubarDev.FtpServer.Commands;
9 |
10 | using Microsoft.Extensions.DependencyInjection;
11 |
12 | namespace FubarDev.FtpServer.CommandHandlers
13 | {
14 | ///
15 | /// The AUTH command handler.
16 | ///
17 | [FtpCommandHandler("AUTH", isLoginRequired: false)]
18 | public class AuthCommandHandler : FtpCommandHandler
19 | {
20 | ///
21 | public override Task Process(FtpCommand command, CancellationToken cancellationToken)
22 | {
23 | var loginStateMachine = Connection.ConnectionServices.GetRequiredService();
24 | return loginStateMachine.ExecuteAsync(command, cancellationToken);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/CommandHandlers/IFtpCommandHandlerExtensionHost.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Collections.Generic;
6 |
7 | namespace FubarDev.FtpServer.CommandHandlers
8 | {
9 | ///
10 | /// Interface indicating that a command handler can act as an extension host.
11 | ///
12 | public interface IFtpCommandHandlerExtensionHost : IFtpCommandHandler
13 | {
14 | ///
15 | /// Gets or sets the extensions hosted by the .
16 | ///
17 | IDictionary Extensions { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/CommandHandlers/NoOpCommandHandler.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) Fubar Development Junker. All rights reserved.
4 | //
5 | // Mark Junker
6 | //-----------------------------------------------------------------------
7 |
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 |
11 | using FubarDev.FtpServer.Commands;
12 |
13 | namespace FubarDev.FtpServer.CommandHandlers
14 | {
15 | ///
16 | /// Implements the NOOP command.
17 | ///
18 | [FtpCommandHandler("NOOP")]
19 | public class NoOpCommandHandler : FtpCommandHandler
20 | {
21 | ///
22 | public override Task Process(FtpCommand command, CancellationToken cancellationToken)
23 | {
24 | return Task.FromResult(new FtpResponse(200, T("NOOP command successful.")));
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/Features/IFtpDataConnectionConfigurationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Features
6 | {
7 | ///
8 | /// Feature that provides information about the data connections.
9 | ///
10 | public interface IFtpDataConnectionConfigurationFeature
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether the data connection mode is limited to EPSV.
14 | ///
15 | bool LimitToEpsv { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/Features/Impl/FtpDataConnectionConfigurationFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.Features.Impl
6 | {
7 | ///
8 | /// Implementation of .
9 | ///
10 | internal class FtpDataConnectionConfigurationFeature : IFtpDataConnectionConfigurationFeature
11 | {
12 | ///
13 | public bool LimitToEpsv { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/Features/Impl/MlstFactsFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Collections.Generic;
7 |
8 | namespace FubarDev.FtpServer.Features.Impl
9 | {
10 | ///
11 | /// Default implementation of .
12 | ///
13 | internal class MlstFactsFeature : IMlstFactsFeature
14 | {
15 | ///
16 | public ISet ActiveMlstFacts { get; } = new HashSet(StringComparer.OrdinalIgnoreCase);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/FubarDev.FtpServer.Commands.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0;netstandard2.1
4 | Commands for the portable FTP server
5 | FubarDev.FtpServer
6 | portable;FTP;server
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/PasvCommandOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// Options for the PASV and EPSV commands.
9 | ///
10 | public class PasvCommandOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether to accept PASV connections from any source.
14 | ///
15 | ///
16 | /// If false (default), connections to a PASV port will only be accepted from the same IP that issued
17 | /// the respective PASV command.
18 | ///
19 | public bool PromiscuousPasv { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/PortCommandOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// Options for the PORT command.
9 | ///
10 | public class PortCommandOptions
11 | {
12 | ///
13 | /// Gets or sets the data port.
14 | ///
15 | public int? DataPort { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Commands/SystCommandOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer
6 | {
7 | ///
8 | /// Options for the SYST command.
9 | ///
10 | public class SystCommandOptions
11 | {
12 | ///
13 | /// Gets or sets the operating system returned by the SYST command.
14 | ///
15 | public string OperatingSystem { get; set; } = "UNIX";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.DotNet/FubarDev.FtpServer.FileSystem.DotNet.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0;netstandard2.1
5 | .NET file system for portable FTP server
6 | file;system;portable;FTP;server
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.GoogleDrive/FubarDev.FtpServer.FileSystem.GoogleDrive.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0;netstandard2.1
5 | Google Drive file system for the portable FTP server
6 | portable;FTP;server;Google;Drive
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.GoogleDrive/GoogleDriveOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.FileSystem.GoogleDrive
6 | {
7 | ///
8 | /// Options for the Google Drive-based file system.
9 | ///
10 | public class GoogleDriveOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether a background upload should be used.
14 | ///
15 | ///
16 | /// If this is set to false, then the direct upload is used.
17 | ///
18 | public bool UseBackgroundUpload { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.GoogleDrive/IGoogleDriveFileSystem.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using Google.Apis.Drive.v3;
6 |
7 | namespace FubarDev.FtpServer.FileSystem.GoogleDrive
8 | {
9 | ///
10 | /// Interface that needs to be implemented by a Google Drive-backed file system.
11 | ///
12 | internal interface IGoogleDriveFileSystem : IUnixFileSystem
13 | {
14 | ///
15 | /// Gets the instance to use to access the Google Drive.
16 | ///
17 | DriveService Service { get; }
18 |
19 | ///
20 | /// Notification when the background upload for the given file is finished.
21 | ///
22 | /// The file ID.
23 | void UploadFinished(string fileId);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.GoogleDrive/IGoogleDriveServiceProvider.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | using Google.Apis.Drive.v3;
9 | using Google.Apis.Drive.v3.Data;
10 |
11 | namespace FubarDev.FtpServer.FileSystem.GoogleDrive
12 | {
13 | ///
14 | /// An interface to get the Google Drive service for the given user.
15 | ///
16 | public interface IGoogleDriveServiceProvider
17 | {
18 | ///
19 | /// Gets the Google Drive service and root entry for the given user.
20 | ///
21 | /// The FTP account to create the for.
22 | /// The cancellation token.
23 | /// The Google Drive service and the root entry.
24 | Task<(DriveService service, File rootEntry)> GetUserRootAsync(IAccountInformation accountInformation, CancellationToken cancellationToken);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.GoogleDrive/StringExtensions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.FileSystem.GoogleDrive
6 | {
7 | ///
8 | /// Extension methods for strings.
9 | ///
10 | internal static class StringExtensions
11 | {
12 | ///
13 | /// Creates a JSON string for a text.
14 | ///
15 | /// The text to create a JSON string for.
16 | /// The created JSON string.
17 | public static string ToJsonString(this string s)
18 | {
19 | var temp = s.Replace(@"\", @"\\")
20 | .Replace("'", @"\'")
21 | .Replace("\"", "\\\"")
22 | .Replace("\r", @"\r")
23 | .Replace("\n", @"\n");
24 | return string.Concat("'", temp, "'");
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.InMemory/FubarDev.FtpServer.FileSystem.InMemory.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0;netstandard2.1
4 | In-memory file system for portable FTP server
5 | file;system;portable;FTP;server
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.S3/FubarDev.FtpServer.FileSystem.S3.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0;netstandard2.1
5 | S3 file system for portable FTP server
6 | portable;FTP;server;AWS;S3
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.S3/S3FileEntry.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO;
6 |
7 | namespace FubarDev.FtpServer.FileSystem.S3
8 | {
9 | ///
10 | /// A file entry for an S3 object.
11 | ///
12 | internal class S3FileEntry : S3FileSystemEntry, IUnixFileEntry
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | /// The S3 object key.
18 | /// The object size.
19 | public S3FileEntry(string key, long size)
20 | : base(key, Path.GetFileName(key))
21 | {
22 | Size = size;
23 | }
24 |
25 | ///
26 | public long Size { get; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.S3/S3FtpServerBuilderExtensions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using FubarDev.FtpServer.FileSystem;
6 | using FubarDev.FtpServer.FileSystem.S3;
7 |
8 | using Microsoft.Extensions.DependencyInjection;
9 |
10 | // ReSharper disable once CheckNamespace
11 | namespace FubarDev.FtpServer
12 | {
13 | ///
14 | /// Extension methods for .
15 | ///
16 | public static class S3FtpServerBuilderExtensions
17 | {
18 | ///
19 | /// Uses S3 as file system.
20 | ///
21 | /// The server builder used to configure the FTP server.
22 | /// the server builder used to configure the FTP server.
23 | public static IFtpServerBuilder UseS3FileSystem(this IFtpServerBuilder builder)
24 | {
25 | builder.Services
26 | .AddSingleton();
27 |
28 | return builder;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.Unix/FubarDev.FtpServer.FileSystem.Unix.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0;netstandard2.1
5 | Unix file system for portable FTP server
6 | unix;file;system;portable;FTP;server
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.Unix/UnixFileEntry.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using Mono.Unix;
6 |
7 | namespace FubarDev.FtpServer.FileSystem.Unix
8 | {
9 | internal class UnixFileEntry : UnixFileSystemEntry, IUnixFileEntry
10 | {
11 | ///
12 | /// Initializes a new instance of the class.
13 | ///
14 | /// The file information.
15 | public UnixFileEntry(UnixFileInfo info)
16 | : base(info)
17 | {
18 | Info = info;
19 | Size = info.Length;
20 | }
21 |
22 | ///
23 | /// Gets the unix file info.
24 | ///
25 | public UnixFileInfo Info { get; }
26 |
27 | ///
28 | public long Size { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.Unix/UnixFileSystemOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.FileSystem.Unix
6 | {
7 | ///
8 | /// Options for the Unix file system.
9 | ///
10 | public class UnixFileSystemOptions
11 | {
12 | ///
13 | /// Gets or sets the default root path.
14 | ///
15 | public string? Root { get; set; }
16 |
17 | ///
18 | /// Gets or sets a value indicating whether the content should be flushed to disk after every write operation.
19 | ///
20 | public bool FlushAfterWrite { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.FileSystem.Unix/UnixFsFtpServerBuilderExtensions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using FubarDev.FtpServer.FileSystem;
6 | using FubarDev.FtpServer.FileSystem.Unix;
7 |
8 | using Microsoft.Extensions.DependencyInjection;
9 |
10 | // ReSharper disable once CheckNamespace
11 | namespace FubarDev.FtpServer
12 | {
13 | ///
14 | /// Extension methods for .
15 | ///
16 | public static class UnixFsFtpServerBuilderExtensions
17 | {
18 | ///
19 | /// Uses the Unix file system API.
20 | ///
21 | /// The server builder used to configure the FTP server.
22 | /// the server builder used to configure the FTP server.
23 | public static IFtpServerBuilder UseUnixFileSystem(this IFtpServerBuilder builder)
24 | {
25 | builder.Services.AddSingleton();
26 | return builder;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.MembershipProvider.Pam/FubarDev.FtpServer.MembershipProvider.Pam.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | netcoreapp3.1
7 | PAM membership provider for portable FTP server
8 | pam;membership;portable;FTP;server
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.MembershipProvider.Pam/PamMembershipProviderOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.MembershipProvider.Pam
6 | {
7 | ///
8 | /// Configuration options for the PAM membership provider.
9 | ///
10 | public class PamMembershipProviderOptions
11 | {
12 | ///
13 | /// Gets or sets a value indicating whether PAM account management should be ignored.
14 | ///
15 | ///
16 | /// This is necessary for WSL where PAM doesn't work.
17 | ///
18 | public bool IgnoreAccountManagement { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.MembershipProvider.Pam/PamSessionFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | using FubarDev.PamSharp;
8 |
9 | namespace FubarDev.FtpServer.MembershipProvider.Pam
10 | {
11 | internal class PamSessionFeature : IDisposable
12 | {
13 | private readonly IPamTransaction _transaction;
14 |
15 | private bool _sessionOpened;
16 |
17 | public PamSessionFeature(IPamTransaction transaction)
18 | {
19 | _transaction = transaction;
20 | }
21 |
22 | public void OpenSession()
23 | {
24 | _transaction.OpenSession();
25 | _sessionOpened = true;
26 | }
27 |
28 | public void Dispose()
29 | {
30 | if (_sessionOpened)
31 | {
32 | _transaction.CloseSession();
33 | }
34 |
35 | _transaction.Dispose();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Shared/FubarDev.FtpServer.Shared.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 52126b62-de83-4597-a832-d144f9a5a870
7 |
8 |
9 | FubarDev.FtpServer
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer.Shared/FubarDev.FtpServer.Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 52126b62-de83-4597-a832-d144f9a5a870
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/AuthTlsOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Security.Cryptography.X509Certificates;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// Options for SSL/TLS connections.
11 | ///
12 | public class AuthTlsOptions
13 | {
14 | ///
15 | /// Gets or sets the server certificate.
16 | ///
17 | public X509Certificate? ServerCertificate { get; set; }
18 |
19 | ///
20 | /// Gets or sets a value indicating whether implicit FTPS is used.
21 | ///
22 | public bool ImplicitFtps { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/CommandExtensions/IFtpCommandHandlerExtensionInstanceInformation.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 |
7 | namespace FubarDev.FtpServer.CommandExtensions
8 | {
9 | ///
10 | /// Interface to get the instance for a command handler extension created through dependency injection.
11 | ///
12 | [Obsolete]
13 | public interface IFtpCommandHandlerExtensionInstanceInformation : IFtpCommandHandlerExtensionInformation
14 | {
15 | ///
16 | /// Gets the FTP command handler extension instance.
17 | ///
18 | IFtpCommandHandlerExtension Instance { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/ConnectionHandlers/IFtpConnectionAdapter.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ConnectionHandlers
6 | {
7 | ///
8 | /// An FTP connection adapter does something with the input and output pipes.
9 | ///
10 | ///
11 | /// It uses a sender and a receiver service to be able to start/stop the tasks.
12 | ///
13 | public interface IFtpConnectionAdapter : IFtpService
14 | {
15 | ///
16 | /// Gets the sender for this connection adapter.
17 | ///
18 | IFtpService Sender { get; }
19 |
20 | ///
21 | /// Gets the pausable receiver for this connection adapter.
22 | ///
23 | IPausableFtpService Receiver { get; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/Features/INetworkStreamFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO.Pipelines;
6 |
7 | using FubarDev.FtpServer.ConnectionHandlers;
8 |
9 | namespace FubarDev.FtpServer.Features
10 | {
11 | ///
12 | /// Features two services for reading from and writing to the network stream.
13 | ///
14 | ///
15 | /// The main purpose for this services is the ability to pause and resume
16 | /// reading/writing from/to the stream to be able to enable TLS on demand.
17 | ///
18 | internal interface INetworkStreamFeature
19 | {
20 | ///
21 | /// Gets the connection adapter that encrypts the network stream with an SslStream or something similar.
22 | ///
23 | IFtpSecureConnectionAdapter SecureConnectionAdapter { get; }
24 |
25 | ///
26 | /// Gets the pipe writer for sending the responses.
27 | ///
28 | PipeWriter Output { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/Features/Impl/NetworkStreamFeature.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO.Pipelines;
6 |
7 | using FubarDev.FtpServer.ConnectionHandlers;
8 |
9 | namespace FubarDev.FtpServer.Features.Impl
10 | {
11 | internal class NetworkStreamFeature : INetworkStreamFeature
12 | {
13 | public NetworkStreamFeature(
14 | IFtpSecureConnectionAdapter secureConnectionAdapter,
15 | PipeWriter output)
16 | {
17 | Output = output;
18 | SecureConnectionAdapter = secureConnectionAdapter;
19 | }
20 |
21 | ///
22 | public IFtpSecureConnectionAdapter SecureConnectionAdapter { get; }
23 |
24 | ///
25 | public PipeWriter Output { get; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/FtpConnectionOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Text;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Options for the FTP connection.
12 | ///
13 | public class FtpConnectionOptions
14 | {
15 | ///
16 | /// Gets or sets the default connection encoding.
17 | ///
18 | public Encoding DefaultEncoding { get; set; } = Encoding.ASCII;
19 |
20 | ///
21 | /// Gets or sets the default connection inactivity timeout.
22 | ///
23 | public TimeSpan? InactivityTimeout { get; set; } = TimeSpan.FromMinutes(5);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/FtpServerStatistics.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 |
7 | namespace FubarDev.FtpServer
8 | {
9 | ///
10 | /// Statistics about the FTP server.
11 | ///
12 | internal class FtpServerStatistics : IFtpServerStatistics
13 | {
14 | private long _totalConnections;
15 | private long _activeConnections;
16 |
17 | ///
18 | public long TotalConnections => _totalConnections;
19 |
20 | ///
21 | public long ActiveConnections => _activeConnections;
22 |
23 | public void AddConnection()
24 | {
25 | Interlocked.Increment(ref _totalConnections);
26 | Interlocked.Increment(ref _activeConnections);
27 | }
28 |
29 | public void CloseConnection()
30 | {
31 | Interlocked.Decrement(ref _activeConnections);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/FubarDev.FtpServer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0;netstandard2.1
5 | TCP-based FTP server implementation
6 | portable;FTP;server
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/ServerCommandHandlers/CloseDataConnectionServerCommandHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | using FubarDev.FtpServer.ServerCommands;
9 |
10 | namespace FubarDev.FtpServer.ServerCommandHandlers
11 | {
12 | ///
13 | /// Handler for the .
14 | ///
15 | public class CloseDataConnectionServerCommandHandler : IServerCommandHandler
16 | {
17 | ///
18 | public Task ExecuteAsync(CloseDataConnectionServerCommand command, CancellationToken cancellationToken)
19 | {
20 | return command.DataConnection.CloseAsync(cancellationToken);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/ServerCommands/IServerCommandExecutor.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FubarDev.FtpServer.ServerCommands
9 | {
10 | ///
11 | /// A server command executor.
12 | ///
13 | public interface IServerCommandExecutor
14 | {
15 | ///
16 | /// Execute the given server command.
17 | ///
18 | /// The server command to execute.
19 | /// The cancellation token.
20 | /// The task.
21 | Task ExecuteAsync(
22 | IServerCommand serverCommand,
23 | CancellationToken cancellationToken);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/ServerCommands/PauseConnectionServerCommand.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ServerCommands
6 | {
7 | ///
8 | /// Pauses the connection (only RX).
9 | ///
10 | public class PauseConnectionServerCommand : IServerCommand
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/ServerCommands/ResumeConnectionServerCommand.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ServerCommands
6 | {
7 | ///
8 | /// Resumes the connection (only RX).
9 | ///
10 | public class ResumeConnectionServerCommand : IServerCommand
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/ServerCommands/TlsEnableServerCommand.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | namespace FubarDev.FtpServer.ServerCommands
6 | {
7 | ///
8 | /// Command to be sent to enable TLS for the control connection.
9 | ///
10 | public class TlsEnableServerCommand : IServerCommand
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/TcpSocketClientAccessor.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System.IO;
6 | using System.Net.Sockets;
7 |
8 | namespace FubarDev.FtpServer
9 | {
10 | ///
11 | /// Accessor to set/get the current .
12 | ///
13 | public class TcpSocketClientAccessor
14 | {
15 | ///
16 | /// Gets or sets the current .
17 | ///
18 | public TcpClient? TcpSocketClient { get; set; }
19 |
20 | ///
21 | /// Gets or sets the to use.
22 | ///
23 | public Stream? TcpSocketStream { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FubarDev.FtpServer/Utilities/NetworkStreamServiceExtensions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Fubar Development Junker. All rights reserved.
3 | //
4 |
5 | using System;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace FubarDev.FtpServer.Utilities
10 | {
11 | internal static class NetworkStreamServiceExtensions
12 | {
13 | internal static async Task> WrapPauseAsync(this IPausableFtpService service, CancellationToken cancellationToken)
14 | {
15 | if (service.Status == FtpServiceStatus.Paused)
16 | {
17 | return () => Task.CompletedTask;
18 | }
19 |
20 | await service.PauseAsync(cancellationToken)
21 | .ConfigureAwait(false);
22 |
23 | return () => service.ContinueAsync(cancellationToken);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/stylecop.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
3 | "settings": {
4 | "documentationRules": {
5 | "companyName": "Fubar Development Junker"
6 | },
7 | "orderingRules": {
8 | "usingDirectivesPlacement": "outsideNamespace"
9 | },
10 | "layoutRules": {
11 | "newlineAtEndOfFile": "require"
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/test/FubarDev.FtpServer.Tests/FubarDev.FtpServer.Tests.v3.ncrunchproject:
--------------------------------------------------------------------------------
1 |
2 |
3 | True
4 |
5 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/DotNet.Glob.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {A45290B4-20F7-48E9-8543-C69240BFB9F8}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Evaluation/AnyCharacterTokenEvaluator.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using DotNet.Globbing.Token;
5 |
6 | namespace DotNet.Globbing.Evaluation
7 | {
8 | internal class AnyCharacterTokenEvaluator : IGlobTokenEvaluator
9 | {
10 | private readonly AnyCharacterToken _token;
11 |
12 | public AnyCharacterTokenEvaluator(AnyCharacterToken token)
13 | {
14 | _token = token;
15 | }
16 |
17 | public bool IsMatch(string allChars, int currentPosition, out int newPosition)
18 | {
19 | newPosition = currentPosition + 1;
20 | var currentChar = allChars[currentPosition];
21 | if (GlobStringReader.IsPathSeperator(currentChar))
22 | {
23 | return false;
24 | }
25 |
26 | return true;
27 | }
28 |
29 | public virtual int ConsumesMinLength
30 | {
31 | get { return 1; }
32 | }
33 |
34 | public bool ConsumesVariableLength
35 | {
36 | get { return false; }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Evaluation/GlobTokenEvaluator.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using DotNet.Globbing.Token;
5 |
6 | namespace DotNet.Globbing.Evaluation
7 | {
8 | internal class GlobTokenEvaluator
9 | {
10 | private readonly CompositeTokenEvaluator _rootTokenEvaluator;
11 | private readonly EvaluationOptions _options;
12 |
13 | public GlobTokenEvaluator(EvaluationOptions options, IGlobToken[] tokens)
14 | {
15 | _options = options;
16 | _rootTokenEvaluator = new CompositeTokenEvaluator(tokens, options.GetTokenEvaluatorFactory());
17 | }
18 |
19 | public bool IsMatch(string text)
20 | {
21 | int finalPosition = 0;
22 | var matched = _rootTokenEvaluator.IsMatch(text, 0, out finalPosition);
23 | return matched;
24 | }
25 |
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Evaluation/IGlobTokenEvaluator.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Evaluation
5 | {
6 | internal interface IGlobTokenEvaluator
7 | {
8 | bool IsMatch(string allChars, int currentPosition, out int newPosition);
9 |
10 | int ConsumesMinLength { get; }
11 | bool ConsumesVariableLength { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Evaluation/IGlobTokenEvaluatorFactory.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using DotNet.Globbing.Token;
5 |
6 | namespace DotNet.Globbing.Evaluation
7 | {
8 | internal interface IGlobTokenEvaluatorFactory
9 | {
10 | IGlobTokenEvaluator CreateTokenEvaluator(AnyCharacterToken token);
11 | IGlobTokenEvaluator CreateTokenEvaluator(CharacterListToken token);
12 | IGlobTokenEvaluator CreateTokenEvaluator(LetterRangeToken token);
13 | IGlobTokenEvaluator CreateTokenEvaluator(LiteralToken token);
14 | IGlobTokenEvaluator CreateTokenEvaluator(NumberRangeToken token);
15 | IGlobTokenEvaluator CreateTokenEvaluator(PathSeperatorToken token);
16 | IGlobTokenEvaluator CreateTokenEvaluator(WildcardDirectoryToken token, CompositeTokenEvaluator nestedCompositeTokenEvaluator);
17 | IGlobTokenEvaluator CreateTokenEvaluator(WildcardToken token, CompositeTokenEvaluator nestedCompositeTokenEvaluator);
18 |
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Evaluation/PathSeperatorTokenEvaluator.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using System;
5 | using DotNet.Globbing.Token;
6 |
7 | namespace DotNet.Globbing.Evaluation
8 | {
9 |
10 | internal class PathSeperatorTokenEvaluator : IGlobTokenEvaluator
11 | {
12 | private readonly PathSeperatorToken _token;
13 |
14 | public PathSeperatorTokenEvaluator(PathSeperatorToken token)
15 | {
16 | _token = token;
17 | }
18 | public bool IsMatch(string allChars, int currentPosition, out int newPosition)
19 | {
20 | var currentChar = allChars[currentPosition];
21 | newPosition = currentPosition + 1;
22 | return GlobStringReader.IsPathSeperator(currentChar);
23 | }
24 |
25 | public virtual int ConsumesMinLength
26 | {
27 | get { return 1; }
28 | }
29 |
30 | public bool ConsumesVariableLength
31 | {
32 | get { return false; }
33 | }
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/EvaluationOptions.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using DotNet.Globbing.Evaluation;
5 |
6 | namespace DotNet.Globbing
7 | {
8 | internal class EvaluationOptions
9 | {
10 | public EvaluationOptions()
11 | {
12 | CaseInsensitive = false;
13 | }
14 |
15 | public bool CaseInsensitive { get; set; }
16 |
17 | public virtual IGlobTokenEvaluatorFactory GetTokenEvaluatorFactory()
18 | {
19 | return new GlobTokenEvaluatorFactory(this);
20 | }
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Generation/IMatchGenerator.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using System.Text;
5 |
6 | namespace DotNet.Globbing.Generation
7 | {
8 | internal interface IMatchGenerator
9 | {
10 | void AppendMatch(StringBuilder builder);
11 |
12 | void AppendNonMatch(StringBuilder builder);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Generation/PathSeperatorMatchGenerator.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using System.Text;
5 | using DotNet.Globbing.Token;
6 | using System;
7 |
8 | namespace DotNet.Globbing.Generation
9 | {
10 | internal class PathSeperatorMatchGenerator : IMatchGenerator
11 | {
12 | private PathSeperatorToken token;
13 | private Random _random;
14 |
15 | public PathSeperatorMatchGenerator(PathSeperatorToken token, Random _random)
16 | {
17 | this.token = token;
18 | this._random = _random;
19 | }
20 |
21 | public void AppendMatch(StringBuilder builder)
22 | {
23 | builder.Append(token.Value);
24 | }
25 |
26 | public void AppendNonMatch(StringBuilder builder)
27 | {
28 | builder.AppendRandomLiteralCharacter(_random);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/GlobOptions.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing
5 | {
6 | internal class GlobOptions
7 | {
8 | public GlobOptions()
9 | {
10 | Evaluation = new EvaluationOptions();
11 | }
12 |
13 | public static GlobOptions Default = new GlobOptions();
14 |
15 | public EvaluationOptions Evaluation { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/GlobTokenMatch.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using DotNet.Globbing.Token;
5 |
6 | namespace DotNet.Globbing
7 | {
8 | internal class GlobTokenMatch
9 | {
10 | public IGlobToken Token { get; set; }
11 | public string Value { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/IGlobTokenVisitor.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using DotNet.Globbing.Token;
5 |
6 | namespace DotNet.Globbing
7 | {
8 | internal interface IGlobTokenVisitor
9 | {
10 | void Visit(WildcardToken token);
11 | void Visit(WildcardDirectoryToken wildcardDirectoryToken);
12 | void Visit(AnyCharacterToken token);
13 | void Visit(LetterRangeToken token);
14 | void Visit(NumberRangeToken token);
15 | void Visit(CharacterListToken token);
16 | void Visit(LiteralToken token);
17 | void Visit(PathSeperatorToken token);
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2015 - present Darrell Tunnell
4 |
5 | All rights reserved.
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/MatchInfo.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using System.Runtime.CompilerServices;
5 | using DotNet.Globbing.Token;
6 |
7 | namespace DotNet.Globbing
8 | {
9 | internal class MatchInfo
10 | {
11 | public GlobTokenMatch[] Matches { get; set; }
12 |
13 | public IGlobToken Missed { get; set; }
14 |
15 | public bool Success { get; set; }
16 |
17 | public string UnmatchedText { get; set; }
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/PathSeperatorKind.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing
5 | {
6 | internal enum PathSeperatorKind
7 | {
8 | ForwardSlash,
9 | BackwardSlash
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/AnyCharacterToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal class AnyCharacterToken : IGlobToken
7 | {
8 | public void Accept(IGlobTokenVisitor Visitor)
9 | {
10 | Visitor.Visit(this);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/CharacterListToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal class CharacterListToken : INegatableToken
7 | {
8 | public CharacterListToken(char[] characters, bool isNegated)
9 | {
10 | Characters = characters;
11 | IsNegated = isNegated;
12 | }
13 |
14 | public bool IsNegated { get; set; }
15 |
16 | public char[] Characters { get; }
17 |
18 | public void Accept(IGlobTokenVisitor Visitor)
19 | {
20 | Visitor.Visit(this);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/IGlobToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal interface IGlobToken : IVisitable
7 | {
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/INegatableToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal interface INegatableToken : IGlobToken
7 | {
8 | bool IsNegated { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/IVisitable.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal interface IVisitable
7 | {
8 | void Accept(T Visitor);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/LetterRangeToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal class LetterRangeToken : RangeToken
7 | {
8 | public LetterRangeToken(char start, char end, bool isNegated) : base(start, end, isNegated)
9 | {
10 | }
11 |
12 | public override void Accept(IGlobTokenVisitor Visitor)
13 | {
14 | Visitor.Visit(this);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/LiteralToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal class LiteralToken : IGlobToken
7 | {
8 | public LiteralToken(string value)
9 | {
10 | Value = value;
11 | }
12 |
13 | public string Value { get; set; }
14 |
15 | public void Accept(IGlobTokenVisitor Visitor)
16 | {
17 | Visitor.Visit(this);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/NumberRangeToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal class NumberRangeToken : RangeToken
7 | {
8 | public NumberRangeToken(char start, char end, bool isNegated) : base(start, end, isNegated)
9 | {
10 | }
11 |
12 | public override void Accept(IGlobTokenVisitor Visitor)
13 | {
14 | Visitor.Visit(this);
15 | }
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/PathSeperatorToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | using System;
5 |
6 | namespace DotNet.Globbing.Token
7 | {
8 | internal class PathSeperatorToken : IGlobToken
9 | {
10 | public PathSeperatorToken(char value)
11 | {
12 | Value = value;
13 | }
14 |
15 | public void Accept(IGlobTokenVisitor Visitor)
16 | {
17 | Visitor.Visit(this);
18 | }
19 |
20 | public char Value { get; set; }
21 |
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/RangeToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal abstract class RangeToken : INegatableToken
7 | {
8 |
9 | protected RangeToken(T start, T end, bool isNegated)
10 | {
11 | Start = start;
12 | End = end;
13 | IsNegated = isNegated;
14 | }
15 |
16 | public bool IsNegated { get; set; }
17 | public T Start { get; set; }
18 | public T End { get; set; }
19 |
20 | public abstract void Accept(IGlobTokenVisitor Visitor);
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/WildcardDirectoryToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal class WildcardDirectoryToken : IGlobToken
7 | {
8 |
9 | public WildcardDirectoryToken(PathSeperatorToken leadingPathSeperator, PathSeperatorToken trailingPathSeperator)
10 | {
11 | TrailingPathSeperator = trailingPathSeperator;
12 | LeadingPathSeperator = leadingPathSeperator;
13 | }
14 |
15 | public PathSeperatorToken TrailingPathSeperator { get; set; }
16 |
17 | public PathSeperatorToken LeadingPathSeperator { get; set; }
18 |
19 | public void Accept(IGlobTokenVisitor Visitor)
20 | {
21 | Visitor.Visit(this);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/third-party/DotNet.Glob/Token/WildcardToken.cs:
--------------------------------------------------------------------------------
1 | // This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis.
2 | //
3 |
4 | namespace DotNet.Globbing.Token
5 | {
6 | internal class WildcardToken : IGlobToken
7 | {
8 | public void Accept(IGlobTokenVisitor Visitor)
9 | {
10 | Visitor.Visit(this);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/third-party/GnuSslStream/GnuSslStream.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | fd524518-e097-4ac0-aac8-d5ea24f31545
7 |
8 |
9 | System.Net.Security
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/third-party/GnuSslStream/GnuSslStream.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | fd524518-e097-4ac0-aac8-d5ea24f31545
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/third-party/ReadLine/Abstractions/Console2.cs:
--------------------------------------------------------------------------------
1 | //
2 |
3 | using System;
4 |
5 | namespace Internal.ReadLine.Abstractions
6 | {
7 | internal class Console2 : IConsole
8 | {
9 | public int CursorLeft => Console.CursorLeft;
10 |
11 | public int CursorTop => Console.CursorTop;
12 |
13 | public int BufferWidth => Console.BufferWidth;
14 |
15 | public int BufferHeight => Console.BufferHeight;
16 |
17 | public bool PasswordMode { get; set; }
18 |
19 | public void SetBufferSize(int width, int height) => Console.SetBufferSize(width, height);
20 |
21 | public void SetCursorPosition(int left, int top)
22 | {
23 | if (!PasswordMode)
24 | {
25 | Console.SetCursorPosition(left, top);
26 | }
27 | }
28 |
29 | public void Write(string value)
30 | {
31 | if (PasswordMode)
32 | {
33 | value = new string(default(char), value.Length);
34 | }
35 |
36 | Console.Write(value);
37 | }
38 |
39 | public void WriteLine(string value) => Console.WriteLine(value);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/third-party/ReadLine/Abstractions/IConsole.cs:
--------------------------------------------------------------------------------
1 | //
2 |
3 | namespace Internal.ReadLine.Abstractions
4 | {
5 | internal interface IConsole
6 | {
7 | int CursorLeft { get; }
8 | int CursorTop { get; }
9 | int BufferWidth { get; }
10 | int BufferHeight { get; }
11 | void SetCursorPosition(int left, int top);
12 | void SetBufferSize(int width, int height);
13 | void Write(string value);
14 | void WriteLine(string value);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/third-party/ReadLine/IAutoCompleteHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 |
3 | using System.Threading.Tasks;
4 |
5 | namespace System
6 | {
7 | internal interface IAutoCompleteHandler
8 | {
9 | char[] Separators { get; set; }
10 | Task GetSuggestionsAsync(string text, int index);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/third-party/ReadLine/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Toni Solarin-Sodara
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/third-party/ReadLine/ReadLine.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | f68f448f-e8a4-4536-9a83-12018b6294b0
7 |
8 |
9 | ReadLine
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/third-party/ReadLine/ReadLine.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | f68f448f-e8a4-4536-9a83-12018b6294b0
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------