Esempio n. 1
0
 public SecretsDirectoryFilePathProvider(
     ISecretsDirectoryPathProvider secretsDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.SecretsDirectoryPathProvider = secretsDirectoryPathProvider;
     this.StringlyTypedPathOperator    = stringlyTypedPathOperator;
 }
 public FunctionalVisualStudioProjectFileSerializationModifier(
     IStringlyTypedPathOperator stringlyTypedPathOperator,
     IVisualStudioProjectFileProjectReferencePathProvider visualStudioProjectFileProjectReferencePathProvider)
 {
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
     this.VisualStudioProjectFileProjectReferencePathProvider = visualStudioProjectFileProjectReferencePathProvider;
 }
        /// <summary>
        /// Create a directory structure for use in testing.
        /// </summary>
        /// <param name="site"></param>
        public static void CreateExampleDirectoryStructure(FileSystemSite site, IStringlyTypedPathOperator stringlyTypedPathOperator)
        {
            var fileSystemOperator = site.FileSystemOperator;

            var baseDirectoryPath = site.DirectoryPath;

            // Create directories.
            var directory01Path = stringlyTypedPathOperator.GetDirectoryPath(baseDirectoryPath, ExampleDirectoryNames.Directory01);
            var directory02Path = stringlyTypedPathOperator.GetDirectoryPath(baseDirectoryPath, ExampleDirectoryNames.Directory02);
            var directory03Path = stringlyTypedPathOperator.GetDirectoryPath(directory02Path, ExampleDirectoryNames.Directory03);
            var directory04Path = stringlyTypedPathOperator.GetDirectoryPath(directory03Path, ExampleDirectoryNames.Directory04);

            foreach (var directoryPath in new string[] { directory01Path, directory02Path, directory03Path, directory04Path })
            {
                fileSystemOperator.CreateDirectoryOnlyIfNotExists(directoryPath);
            }

            // Create files.
            var file01Path = stringlyTypedPathOperator.GetFilePath(baseDirectoryPath, ExampleFileNames.File01Name);
            var file02Path = stringlyTypedPathOperator.GetFilePath(directory01Path, ExampleFileNames.File02Name);
            var file03Path = stringlyTypedPathOperator.GetFilePath(directory02Path, ExampleFileNames.File03Name);
            var file04Path = stringlyTypedPathOperator.GetFilePath(directory02Path, ExampleFileNames.File04Name);
            var file05Path = stringlyTypedPathOperator.GetFilePath(directory03Path, ExampleFileNames.File05Name);
            var file06Path = stringlyTypedPathOperator.GetFilePath(directory04Path, ExampleFileNames.File06Name);

            foreach (var filePath in new string[] { file01Path, file02Path, file03Path, file04Path, file05Path, file06Path })
            {
                using (var writer = fileSystemOperator.CreateFileText(filePath))
                {
                    writer.WriteLine("CONTENT!");
                }
            }
        }
 public RelativeFilePathsVisualStudioProjectFileStreamSerializer(
     IStringlyTypedPathOperator stringlyTypedPathOperator,
     IVisualStudioProjectFileToXElementConverter visualStudioProjectFileToXElementConverter)
 {
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
     this.VisualStudioProjectFileToXElementConverter = visualStudioProjectFileToXElementConverter;
 }
        /// <summary>
        /// Produces paths where directory paths are directory-indicated, and file paths are file-indicated.
        /// Returns all file-entries in sorted order.
        /// </summary>
        /// <remarks>
        /// This method involves two calls to the file-system via <see cref="Directory.EnumerateDirectories(string, string, SearchOption)"/> and <see cref="Directory.EnumerateFiles(string, string, SearchOption)"/>.
        /// </remarks>
        public static IEnumerable <string> EnumerateFileSystemEntryPaths(IStringlyTypedPathOperator stringlyTypedPathOperator, string directoryPath, bool recursive = false)
        {
            var directoryExists = stringlyTypedPathOperator.ExistsDirectoryPath(directoryPath);

            if (!directoryExists)
            {
                return(Enumerable.Empty <string>());
            }

            var searchOption = SearchOptionHelper.RecursiveToSearchOption(recursive);

            var subDirectoryPaths = Directory.EnumerateDirectories(directoryPath, SearchPatternHelper.All, searchOption);
            var filePaths         = Directory.EnumerateFiles(directoryPath, SearchPatternHelper.All, searchOption);

            var allPaths = new List <string>();

            foreach (var subDirectoryPath in subDirectoryPaths)
            {
                // Directory paths are NOT directory-indicated coming from the Directory.EnumerateDirectories() API.
                var outputDirectoryPath = stringlyTypedPathOperator.EnsureDirectoryPathIsDirectoryIndicated(subDirectoryPath);

                allPaths.Add(outputDirectoryPath);
            }

            // File paths ARE file-indicated (not directory-indicated) from from the Directory.EnumerateFiles() API.
            allPaths.AddRange(filePaths);

            // Sort file paths to return them in order.
            allPaths.Sort();

            return(allPaths);
        }
 public SecretsDirectoryPathProvider(
     IOrganizationDataDirectoryPathProvider organizationDataDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.OrganizationDataDirectoryPathProvider = organizationDataDirectoryPathProvider;
     this.StringlyTypedPathOperator             = stringlyTypedPathOperator;
 }
Esempio n. 7
0
 public OrganizationSharedDataDirectoryFilePathProvider(
     IOrganizationSharedDataDirectoryPathProvider organizationSharedDataDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.OrganizationSharedDataDirectoryPathProvider = organizationSharedDataDirectoryPathProvider;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
 public MessagesOutputBaseDirectoryPathProvider(
     ITemporaryDirectoryPathProvider temporaryDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.TemporaryDirectoryPathProvider = temporaryDirectoryPathProvider;
     this.StringlyTypedPathOperator      = stringlyTypedPathOperator;
 }
 public ConstructionTimeMessagesOutputDirectoryPathProvider(
     IProgramSpecificMessagesOutputDirectoryPathProvider programSpecificMessagesOutputDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.ProgramSpecificMessagesOutputDirectoryPathProvider = programSpecificMessagesOutputDirectoryPathProvider;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
Esempio n. 10
0
 public ConstructionTimeProjectFileDeserializationMessagesOutputFileNameProvider(
     IFileNameOperator fileNameOperator,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.FileNameOperator          = fileNameOperator;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
 public OutputFilePathProvider(
     IOutputDirectoryPathProvider outputDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.OutputDirectoryPathProvider = outputDirectoryPathProvider;
     this.StringlyTypedPathOperator   = stringlyTypedPathOperator;
 }
Esempio n. 12
0
 public TemporaryDirectoryFilePathProvider(
     ITemporaryDirectoryPathProvider temporaryDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.TemporaryDirectoryPathProvider = temporaryDirectoryPathProvider;
     this.StringlyTypedPathOperator      = stringlyTypedPathOperator;
 }
        /// <summary>
        /// Gets the <see cref="FileSystemEntryType"/> for an actually existing path.
        /// </summary>
        /// <param name="stringlyTypedPathOperator"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        public static FileSystemEntryType GetFileSystemEntryTypeForExistingPath(this IStringlyTypedPathOperator stringlyTypedPathOperator, string path)
        {
            var isDirectory = stringlyTypedPathOperator.IsDirectory(path);

            var entryType = FileSystemEntryTypeHelper.IsDirectoryToFileSystemEntryType(isDirectory);

            return(entryType);
        }
Esempio n. 14
0
        /// <summary>
        /// Performs special solution directory path-relative formatting.
        /// </summary>
        public static string GetProjectFilePath(this IStringlyTypedPathOperator stringlyTypedPathOperator, string solutionFilePath, string projectFileRelativePath)
        {
            var solutionFileDirectoryPath = stringlyTypedPathOperator.GetDirectoryPathForFilePath(solutionFilePath);

            var projectFilePath = stringlyTypedPathOperator.Combine(solutionFileDirectoryPath, projectFileRelativePath);

            return(projectFilePath);
        }
 public SecretsFileLocalDeploymentDestinationFileSystemSiteProvider(
     ILocalDeploymentSecretsSerializationProvider localDeploymentSecretsSerializationProvider,
     ILocalFileSystemOperator localFileSystemOperator,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.LocalDeploymentSecretsSerializationProvider = localDeploymentSecretsSerializationProvider;
     this.LocalFileSystemOperator   = localFileSystemOperator;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
 public ProjectFileDeserializationMessagesOutputFileNameProvider(
     IFileNameOperator fileNameOperator,
     IGuidProvider guidProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.FileNameOperator          = fileNameOperator;
     this.GuidProvider              = guidProvider;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
Esempio n. 17
0
 public CDriveTemporaryDirectoryPathProvider(
     ICDrivePathProvider cDrivePathProvider,
     ITemporaryDirectoryNameConvention temporaryDirectoryNameConvention,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.CDrivePathProvider = cDrivePathProvider;
     this.TemporaryDirectoryNameConvention = temporaryDirectoryNameConvention;
     this.StringlyTypedPathOperator        = stringlyTypedPathOperator;
 }
 public SecretsFileRemoteDeploymentDestinationFileSystemSiteProvider(
     IRemoteDeploymentSecretsSerializationProvider remoteDeploymentSecretsSerializationProvider,
     IRemoteFileSystemOperator remoteFileSystemOperator,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.RemoteDeploymentSecretsSerializationProvider = remoteDeploymentSecretsSerializationProvider;
     this.RemoteFileSystemOperator  = remoteFileSystemOperator;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
Esempio n. 19
0
 public ProgramNameStartTimeMessagesOutputDirectoryPathProvider(
     IProcessStartTimeUtcDirectoryNameProvider processStartTimeUtcDirectoryNameProvider,
     IProgramSpecificMessagesOutputDirectoryPathProvider programSpecificMessagesOutputDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.ProcessStartTimeUtcDirectoryNameProvider           = processStartTimeUtcDirectoryNameProvider;
     this.ProgramSpecificMessagesOutputDirectoryPathProvider = programSpecificMessagesOutputDirectoryPathProvider;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
Esempio n. 20
0
 public DefaultAppSettingsJsonFilePathProvider(
     IAppSettingsDirectoryPathProvider appSettingsDirectoryPathProvider,
     IDefaultAppSettingsJsonFileNameProvider defaultAppSettingsJsonFileNameProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.AppSettingsDirectoryPathProvider       = appSettingsDirectoryPathProvider;
     this.DefaultAppSettingsJsonFileNameProvider = defaultAppSettingsJsonFileNameProvider;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
Esempio n. 21
0
 public DefaultDeploymentSourceFileSystemSiteProvider(
     IProjectBuildOutputBinariesDirectoryPathProvider projectOutputBinariesDirectoryPathProvider,
     ILocalFileSystemOperator localFileSystemOperator,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.ProjectBuildOutputBinariesDirectoryPathProvider = projectOutputBinariesDirectoryPathProvider;
     this.LocalFileSystemOperator   = localFileSystemOperator;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
Esempio n. 22
0
 public DataDirectoryTestingDataDirectoryPathProvider(
     IDataDirectoryPathProvider dataDirectoryPathProvider,
     ITestingDataDirectoryNameConvention testingDataDirectoryNameConvention,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.DataDirectoryPathProvider          = dataDirectoryPathProvider;
     this.TestingDataDirectoryNameConvention = testingDataDirectoryNameConvention;
     this.StringlyTypedPathOperator          = stringlyTypedPathOperator;
 }
Esempio n. 23
0
 public TestingDataDirectoryContentPathsProvider(
     ITestingDataDirectoryPathProvider testingDataDirectoryPathProvider,
     ITestingDataDirectoryContentConventions testingDataDirectoryContentConventions,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.TestingDataDirectoryPathProvider       = testingDataDirectoryPathProvider;
     this.TestingDataDirectoryContentConventions = testingDataDirectoryContentConventions;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
Esempio n. 24
0
 public DropboxOrganizationsDirectoryPathProvider(
     IDropboxDirectoryPathProvider dropboxDirectoryPathProvider,
     IOrganizationsDirectoryNameConvention organizationsDirectoryNameConvention,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.DropboxDirectoryPathProvider         = dropboxDirectoryPathProvider;
     this.OrganizationsDirectoryNameConvention = organizationsDirectoryNameConvention;
     this.StringlyTypedPathOperator            = stringlyTypedPathOperator;
 }
 public DefaultHumanOutputFilePathProvider(
     IHumanOutputFileDirectoryPathProvider humanOutputFileDirectoryPathProvider,
     IHumanOutputFileNameProvider humanOutputFileNameProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.HumanOutputFileDirectoryPathProvider = humanOutputFileDirectoryPathProvider;
     this.HumanOutputFileNameProvider          = humanOutputFileNameProvider;
     this.StringlyTypedPathOperator            = stringlyTypedPathOperator;
 }
Esempio n. 26
0
 public ProgramNameStartTimeFunctionalityMessagesOutputDirectoryPathProvider(
     FunctionalityDirectoryNameProvider functionalityDirectoryNameProvider,
     IProgramStartTimeSpecificMessagesOutputDirectoryPathProvider programStartTimeSpecificMessagesOutputDirectoryPathProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.FunctionalityDirectoryNameProvider = functionalityDirectoryNameProvider;
     this.ProgramStartTimeSpecificMessagesOutputDirectoryPathProvider = programStartTimeSpecificMessagesOutputDirectoryPathProvider;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
 public UserProfileDropboxDirectoryPathProvider(
     IUserProfileDirectoryPathProvider userProfileDirectoryPathProvider,
     IDropboxDirectoryNameConvention dropboxDirectoryNameConvention,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.UserProfileDirectoryPathProvider = userProfileDirectoryPathProvider;
     this.DropboxDirectoryNameConvention   = dropboxDirectoryNameConvention;
     this.StringlyTypedPathOperator        = stringlyTypedPathOperator;
 }
        public FileSystemOperatorSelfTestFixture(IFileSystemOperator fileSystemOperator, string rootDirectoryPath, IStringlyTypedPathOperator stringlyTypedPathOperator)
        {
            this.FileSystemOperator        = fileSystemOperator;
            this.RootDirectoryPath         = rootDirectoryPath;
            this.StringlyTypedPathOperator = stringlyTypedPathOperator;

            // Ensure the root directory is created.
            this.FileSystemOperator.CreateDirectoryOnlyIfNotExists(this.RootDirectoryPath);
        }
 public OrganizationStringlyTypedPathOperator(
     IOrganizationsStringlyTypedPathOperator organizationsStringlyTypedPathOperator,
     IOrganizationDirectoryNameProvider organizationDirectoryNameProvider,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.OrganizationsStringlyTypedPathOperator = organizationsStringlyTypedPathOperator;
     this.OrganizationDirectoryNameProvider      = organizationDirectoryNameProvider;
     this.StringlyTypedPathOperator = stringlyTypedPathOperator;
 }
 public SharedRivetOrganizationDirectoryPathProvider(
     IDropboxDirectoryPathProvider dropboxDirectoryPathProvider,
     IOrganizationStringlyTypedPathOperator organizationStringlyTypedPathOperator,
     IStringlyTypedPathOperator stringlyTypedPathOperator)
 {
     this.DropboxDirectoryPathProvider          = dropboxDirectoryPathProvider;
     this.OrganizationStringlyTypedPathOperator = organizationStringlyTypedPathOperator;
     this.StringlyTypedPathOperator             = stringlyTypedPathOperator;
 }