Beispiel #1
0
        internal static void Deploy(Application application, string sourceDir
                                    , System.IO.Abstractions.IFileSystem fileSystem
                                    , string relativePathUnderVDir = "")
        {
            if (!fileSystem.Directory.Exists(sourceDir))
            {
                throw new System.Exception(string.Format("Failed to deploy files to application, source directory does not exist: '{0}'.", sourceDir));
            }

            if (application.VirtualDirectories.Count <= 0)
            {
                throw new System.Exception(string.Format("Application '{0}' does not have a virtual directory.", application.Path));
            }

            var physicalPath = application.VirtualDirectories[0].PhysicalPath;

            if (!fileSystem.Directory.Exists(physicalPath))
            {
                fileSystem.Directory.CreateDirectory(physicalPath);
            }

            var relativeDirectoryPath = System.IO.Path.Combine(physicalPath, relativePathUnderVDir);

            if (!fileSystem.Directory.Exists(relativeDirectoryPath))
            {
                fileSystem.Directory.CreateDirectory(relativeDirectoryPath);
            }

            fileSystem.DirectoryCopy(sourceDir, relativeDirectoryPath);

            if (string.IsNullOrEmpty(relativeDirectoryPath))
            {
                fileSystem.DirectorySetAttribute(relativeDirectoryPath, System.IO.FileAttributes.Normal);
            }
        }
Beispiel #2
0
 public YTDLMusicProvider(
     IFileSystem fileSystem,
     ILogger <YTDLMusicProvider> logger,
     IServerConfigurationManager config,
     System.IO.Abstractions.IFileSystem afs) : base(fileSystem, logger, config, afs)
 {
 }
Beispiel #3
0
        public static void DirectorySetAttribute(this System.IO.Abstractions.IFileSystem fileSystem, string relativeDirectoryPath, System.IO.FileAttributes attrib)
        {
            System.IO.Abstractions.IDirectoryInfo di = fileSystem.DirectoryInfo
                                                       .FromDirectoryName(relativeDirectoryPath);

            di.Attributes |= attrib;
        }
Beispiel #4
0
 public ExtractP4kContent(IFileSystem fileSystem,
                          IOutputDirectory outputDirectory,
                          IMessageQueue messages)
 {
     _fileSystem      = fileSystem;
     _outputDirectory = outputDirectory;
     _messages        = messages;
 }
 public InferPackageDetailsFromSingleFoundExecutable(System.IO.Abstractions.IFileSystem fs, 
     IPackageDetailsFromAssemblyMapper fromAssemblyMapper,
     ILog log)
 {
     _fs = fs;
     _fromAssemblyMapper = fromAssemblyMapper;
     _log = log;
 }
 public FixClonedOsRegistryMigrationStep(ILogger <FixClonedOsRegistryMigrationStep> logger,
                                         IFileSystemHelper fileSystemHelper,
                                         System.IO.Abstractions.IFileSystem fileSystem,
                                         MigrationFlowData migrationData) : base(migrationData)
 {
     this.logger           = logger;
     this.fileSystemHelper = fileSystemHelper;
     this.fileSystem       = fileSystem;
 }
Beispiel #7
0
 public ShrinkVhdVolumeMigrationStep(ILogger <ShrinkVhdVolumeMigrationStep> logger,
                                     IFileSystemHelper fileSystemHelper,
                                     System.IO.Abstractions.IFileSystem fileSystem,
                                     MigrationFlowData migrationData) : base(migrationData)
 {
     this.logger           = logger;
     this.fileSystemHelper = fileSystemHelper;
     this.fileSystem       = fileSystem;
 }
Beispiel #8
0
 public NuGetFeedAppInstallationLocator(IPackageSourceConfiguration packageSourceConfiguration, IFileSystem fs,
                                        IGetLatestNuGetPackageByNameQuery latestPackageQuery,
                                        IGetNuGetPackageByNameAndVersionQuery packageByNameAndVersionQuery)
 {
     _packageSourceConfiguration = packageSourceConfiguration;
     _fs = fs;
     _latestPackageQuery           = latestPackageQuery;
     _packageByNameAndVersionQuery = packageByNameAndVersionQuery;
 }
 public CloneTempVhdToFinalVhdMigrationStep(ILogger <CloneTempVhdToFinalVhdMigrationStep> logger,
                                            IFileSystemHelper fileSystemHelper,
                                            System.IO.Abstractions.IFileSystem fileSystem,
                                            MigrationFlowData migrationData) : base(migrationData)
 {
     this.logger           = logger;
     this.fileSystemHelper = fileSystemHelper;
     this.fileSystem       = fileSystem;
 }
 public AbstractYoutubeRemoteProvider(IFileSystem fileSystem,
                                      ILogger <B> logger,
                                      IServerConfigurationManager config,
                                      System.IO.Abstractions.IFileSystem afs)
 {
     _config     = config;
     _fileSystem = fileSystem;
     _logger     = logger;
     _afs        = afs;
 }
Beispiel #11
0
        public LocalFileSystemPublisher(
            System.IO.Abstractions.IFileSystem fileSystem, IPublisherExtension ext, ILogger logger,
            ITargetDirectoryCleaner targetCleaner)
        {
            m_FileSystem = fileSystem;
            m_Ext        = ext;
            m_Logger     = logger;

            m_TargetCleaner = targetCleaner;
        }
 public NuGetPackageExtractor(System.IO.Abstractions.IFileSystem fs, ILog log, IPackageCache packageCache,
                              TextWriter output, IInstanceConfiguration instanceConfiguration, IApplicationMap applicationMap)
 {
     _fs                    = fs;
     _log                   = log;
     _packageCache          = packageCache;
     _output                = output;
     _instanceConfiguration = instanceConfiguration;
     _applicationMap        = applicationMap;
 }
Beispiel #13
0
 public PackageCache(System.IO.Abstractions.IFileSystem fs, ILog log,
                     IInstanceConfiguration instanceConfiguration, IApplicationMap applicationMap,
                     TextWriter output)
 {
     _fs  = fs;
     _log = log;
     _instanceConfiguration = instanceConfiguration;
     _applicationMap        = applicationMap;
     _output = output;
 }
Beispiel #14
0
        public NuGetPackageCache(IFileSystem fileSystem, string cacheDirectory)
        {
            if (fileSystem == null) throw new ArgumentNullException("fileSystem");
            if (string.IsNullOrWhiteSpace(cacheDirectory)) throw new ArgumentException("", "cacheDirectory");

            _fileSystem = fileSystem;
            _cacheDirectory = cacheDirectory;

            _fileSystem.EnsureDirectoryExists(_cacheDirectory);
        }
        public ILessEngine GetEngine(IFileSystem fileSystem, string directory)
        {
            IStylizer stylizer = new HtmlStylizer();

            IPathResolver pathResolver = new TestPathResolver(directory);
            IFileReader reader = new TestFileReader(fileSystem, pathResolver);
            var importer = new Importer(reader);
            var parser = new Parser(stylizer, importer);
            ILogger logger = new ConsoleLogger(LogLevel.Error);
            return new LessEngine(parser, logger, true, true);
        }
 public AbstractYoutubeImageRemoteProvider(IFileSystem fileSystem,
                                           ILogger <B> logger,
                                           IServerConfigurationManager config,
                                           IHttpClientFactory httpClientFactory,
                                           System.IO.Abstractions.IFileSystem afs)
 {
     _config            = config;
     _fileSystem        = fileSystem;
     _httpClientFactory = httpClientFactory;
     _logger            = logger;
     _afs = afs;
 }
Beispiel #17
0
        public ILessEngine GetEngine(IFileSystem fileSystem, string directory)
        {
            IStylizer stylizer = new HtmlStylizer();

            IPathResolver pathResolver = new TestPathResolver(directory);
            IFileReader   reader       = new TestFileReader(fileSystem, pathResolver);
            var           importer     = new Importer(reader);
            var           parser       = new Parser(stylizer, importer);
            ILogger       logger       = new ConsoleLogger(LogLevel.Error);

            return(new LessEngine(parser, logger, true, true));
        }
Beispiel #18
0
        public OpenP4kFileCommand(ICurrentP4k currentP4k,
                                  IFileSystem fileSystem,
                                  IMessageQueue messages,
                                  IProgress progress)
        {
            _currentP4K = currentP4k;
            _fileSystem = fileSystem;
            _messages   = messages;
            _progress   = progress;

            _command = new AsyncCommand(async() => { await OpenP4kFile(); });
        }
Beispiel #19
0
 public UpdateCommand(IEnumerable <IAppInstallationLocator> finders, IInstanceConfiguration instanceConfiguration,
                      TextWriter output, IListLatestVersionsOfPackagesQuery query, DeploydConfiguration deployd,
                      IInstallationRoot installationRoot, System.IO.Abstractions.IFileSystem fs,
                      IPackageSourceConfiguration packageSourceConfiguration)
 {
     _finders = finders;
     _instanceConfiguration = instanceConfiguration;
     _output           = output;
     _query            = query;
     _deployd          = deployd;
     _installationRoot = installationRoot;
     _fs = fs;
     _packageSourceConfiguration = packageSourceConfiguration;
 }
Beispiel #20
0
 public ShowStateCommand(IApplication app,
                         TextWriter output, IEnumerable <IAppInstallationLocator> finders,
                         IInstanceConfiguration instanceConfiguration,
                         IListLatestVersionsOfPackagesQuery query,
                         System.IO.Abstractions.IFileSystem fs,
                         IPackageSourceConfiguration packageSourceConfiguration,
                         IInstallationRoot installationRoot)
 {
     _app     = app;
     _output  = output;
     _finders = finders;
     _instanceConfiguration = instanceConfiguration;
     _query = query;
     _fs    = fs;
     _packageSourceConfiguration = packageSourceConfiguration;
     _installationRoot           = installationRoot;
 }
Beispiel #21
0
        public static void DirectoryCopy(this System.IO.Abstractions.IFileSystem fileSystem, string sourceDirName, string destDirName, bool copySubDirs)
        {
            // Get the subdirectories for the specified directory.
            System.IO.Abstractions.IDirectoryInfo dir = fileSystem.DirectoryInfo.FromDirectoryName(sourceDirName);


            if (!dir.Exists)
            {
                throw new System.IO.DirectoryNotFoundException(
                          "Source directory does not exist or could not be found: "
                          + sourceDirName);
            }

            System.IO.Abstractions.IDirectoryInfo[] dirs = dir.GetDirectories();

            // If the destination directory doesn't exist, create it.
            if (!fileSystem.Directory.Exists(destDirName))
            {
                fileSystem.Directory.CreateDirectory(destDirName);
            }



            // Get the files in the directory and copy them to the new location.
            System.IO.Abstractions.IFileInfo[] files = dir.GetFiles();
            foreach (System.IO.Abstractions.IFileInfo file in files)
            {
                string temppath = fileSystem.Path.Combine(destDirName, file.Name);
                file.CopyTo(temppath, false);
            }

            // If copying subdirectories, copy them and their contents to new location.
            if (copySubDirs)
            {
                foreach (System.IO.Abstractions.IDirectoryInfo subdir in dirs)
                {
                    string temppath = fileSystem.Path.Combine(destDirName, subdir.Name);
                    DirectoryCopy(fileSystem, subdir.FullName, temppath, copySubDirs);
                }
            }
        }
 public PackageFileLocator(IFileSystem fs, ILog log)
 {
     _fs  = fs;
     _log = log;
 }
Beispiel #23
0
 public NuGetPackageCache(IFileSystem fileSystem, IAgentSettings agentSettings)
     : this(fileSystem, agentSettings.CacheDirectory)
 {
 }
 public InstalledPackageArchive(IAgentSettingsManager agentSettingsManager, IFileSystem fileSystem, ILocalPackageCache packageCache)
 {
     _agentSettingsManager = agentSettingsManager;
     _fileSystem = fileSystem;
     _packageCache = packageCache;
 }
Beispiel #25
0
 public TestFileReader(IFileSystem fileSystem, IPathResolver pathResolver)
 {
     this.fileSystem = fileSystem;
     this.pathResolver = pathResolver;
 }
 public ZipFilePackageExtractor(System.IO.Abstractions.IFileSystem fs, ILog log)
 {
     _fs = fs;
     _log = log;
 }
Beispiel #27
0
 public ManifestHandler(System.IO.Abstractions.IFileSystem fileSystem)
 {
     this.fileSystem = fileSystem;
 }
Beispiel #28
0
 public FileSystemAppInstallationLocator(IPackageSourceConfiguration packageSourceConfiguration, IFileSystem fs, ILog log)
 {
     _packageSourceConfiguration = packageSourceConfiguration;
     _fs  = fs;
     _log = log;
 }
 public TestFileReader(IFileSystem fileSystem, IPathResolver pathResolver)
 {
     this.fileSystem   = fileSystem;
     this.pathResolver = pathResolver;
 }
 public ChauffeurSettings(TextWriter writer, IFileSystem fileSystem)
 {
     this.writer = writer;
     this.fileSystem = fileSystem;
 }
 public FileSystemAdapter(System.IO.Abstractions.IFileSystem fileSystem)
 {
     _fileSystem = fileSystem;
 }
 public FileSystemForTesting(System.IO.Abstractions.IFileSystem fileSystem)
 => this.fileSystem = fileSystem;
Beispiel #33
0
 public ChauffeurSettings(TextWriter writer, IFileSystem fileSystem)
 {
     this.writer     = writer;
     this.fileSystem = fileSystem;
 }
 public PackageFileLocator(IFileSystem fs, ILog log)
 {
     _fs = fs;
     _log = log;
 }
Beispiel #35
0
 public FileSystemPhysicalFileProvider(System.IO.Abstractions.IFileSystem fileSystem, string root)
 {
     FileSystem = fileSystem;
     Root       = root;
 }
 public DiscoverPackageConfigurationMetadataFile(System.IO.Abstractions.IFileSystem fs, IConventionsSettingsFileLoader settingsFileLoader)
 {
     _fs = fs;
     _settingsFileLoader = settingsFileLoader;
 }
Beispiel #37
0
 public LocalFileSystemFileLoader(System.IO.Abstractions.IFileSystem fileSystem, ILogger logger)
 {
     m_FileSystem = fileSystem;
     m_Logger     = logger;
 }
Beispiel #38
0
 public static void DirectoryCopy(this System.IO.Abstractions.IFileSystem fileSystem, string sourceDirName, string destDirName)
 {
     DirectoryCopy(fileSystem, sourceDirName, destDirName, true);
 }
Beispiel #39
0
 public ConventionsSettingsFileLoader(System.IO.Abstractions.IFileSystem fs)
 {
     _fs = fs;
 }
 public ConventionsSettingsFileLoader(System.IO.Abstractions.IFileSystem fs)
 {
     _fs = fs;
 }
Beispiel #41
0
 public Camera(System.IO.Abstractions.IFileSystem fileSystem)
 {
     this.fileSystem = fileSystem;
 }
 public NuGetPackageCache(IFileSystem fileSystem, IAgentSettingsManager agentSettings, ILogger logger)
     : this(fileSystem, agentSettings.Settings.CacheDirectory)
 {
     Logger = logger;
 }