private static string GetDefaultDotNetReferenceAssembliesPath(IFileSystem fileSystem, IRuntimeEnvironment runtimeEnvironment) { var os = runtimeEnvironment.OperatingSystemPlatform; if (os == Platform.Windows) { return null; } if (os == Platform.Darwin && fileSystem.Directory.Exists("/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks")) { return "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks"; } if (fileSystem.Directory.Exists("/usr/local/lib/mono/xbuild-frameworks")) { return "/usr/local/lib/mono/xbuild-frameworks"; } if (fileSystem.Directory.Exists("/usr/lib/mono/xbuild-frameworks")) { return "/usr/lib/mono/xbuild-frameworks"; } return null; }
public RepositorySettings(ISolutionManager solutionManager, IFileSystemProvider fileSystemProvider, IVsSourceControlTracker sourceControlTracker) { if (solutionManager == null) { throw new ArgumentNullException("solutionManager"); } if (fileSystemProvider == null) { throw new ArgumentNullException("fileSystemProvider"); } if (sourceControlTracker == null) { throw new ArgumentNullException("sourceControlTracker"); } _solutionManager = solutionManager; _fileSystemProvider = fileSystemProvider; EventHandler resetConfiguration = (sender, e) => { // Kill our configuration cache when someone closes the solution _configurationPath = null; _fileSystem = null; }; _solutionManager.SolutionClosing += resetConfiguration; sourceControlTracker.SolutionBoundToSourceControl += resetConfiguration; }
public ConnectInfoForm() { XmlConfigurator.Configure(); var settings = new NinjectSettings() { LoadExtensions = false }; this.mKernel = new StandardKernel( settings, new Log4NetModule(), new ReportServerRepositoryModule()); //this.mKernel.Load<FuncModule>(); this.mLoggerFactory = this.mKernel.Get<ILoggerFactory>(); this.mFileSystem = this.mKernel.Get<IFileSystem>(); this.mLogger = this.mLoggerFactory.GetCurrentClassLogger(); InitializeComponent(); this.LoadSettings(); // Create the DebugForm and hide it if debug is False this.mDebugForm = new DebugForm(); this.mDebugForm.Show(); if (!this.mDebug) this.mDebugForm.Hide(); }
public Bundler(IFileSystem system, IDeploymentController controller, DeploymentSettings settings, IBottleRepository bottles) { _system = system; _controller = controller; _settings = settings; _bottles = bottles; }
public CollectionManager(ILibraryManager libraryManager, IFileSystem fileSystem, ILibraryMonitor iLibraryMonitor, ILogger logger) { _libraryManager = libraryManager; _fileSystem = fileSystem; _iLibraryMonitor = iLibraryMonitor; _logger = logger; }
public void Init() { fileSystemMock = new Mock<IFileSystem>(); var volumeProvider = new MockedVolumeProvider(); fileSystem = new VolumeFileSystemDecorator(fileSystemMock.Object, volumeProvider); }
public static IAppBuilder UseRazor(this IAppBuilder builder, IFileSystem fileSystem) { Requires.NotNull(builder, "builder"); Requires.NotNull(fileSystem, "fileSystem"); return UseRazor(builder, fileSystem, "/"); }
/// <summary> /// Sets the initial item values. /// </summary> /// <param name="item">The item.</param> /// <param name="parent">The parent.</param> /// <param name="fileSystem">The file system.</param> /// <param name="libraryManager">The library manager.</param> /// <param name="directoryService">The directory service.</param> /// <exception cref="System.ArgumentException">Item must have a path</exception> public static void SetInitialItemValues(BaseItem item, Folder parent, IFileSystem fileSystem, ILibraryManager libraryManager, IDirectoryService directoryService) { // This version of the below method has no ItemResolveArgs, so we have to require the path already being set if (string.IsNullOrWhiteSpace(item.Path)) { throw new ArgumentException("Item must have a Path"); } // If the resolver didn't specify this if (parent != null) { item.Parent = parent; } item.Id = libraryManager.GetNewItemId(item.Path, item.GetType()); item.IsLocked = item.Path.IndexOf("[dontfetchmeta]", StringComparison.OrdinalIgnoreCase) != -1 || item.Parents.Any(i => i.IsLocked); // Make sure DateCreated and DateModified have values var fileInfo = directoryService.GetFile(item.Path); item.DateModified = fileSystem.GetLastWriteTimeUtc(fileInfo); SetDateCreated(item, fileSystem, fileInfo); EnsureName(item, fileInfo); }
/// <summary> /// Sets the initial item values. /// </summary> /// <param name="item">The item.</param> /// <param name="args">The args.</param> /// <param name="fileSystem">The file system.</param> /// <param name="libraryManager">The library manager.</param> public static void SetInitialItemValues(BaseItem item, ItemResolveArgs args, IFileSystem fileSystem, ILibraryManager libraryManager) { // If the resolver didn't specify this if (string.IsNullOrEmpty(item.Path)) { item.Path = args.Path; } // If the resolver didn't specify this if (args.Parent != null) { item.Parent = args.Parent; } item.Id = libraryManager.GetNewItemId(item.Path, item.GetType()); // Make sure the item has a name EnsureName(item, args.FileInfo); item.IsLocked = item.Path.IndexOf("[dontfetchmeta]", StringComparison.OrdinalIgnoreCase) != -1 || item.Parents.Any(i => i.IsLocked); // Make sure DateCreated and DateModified have values EnsureDates(fileSystem, item, args, true); }
public static void Run(Arguments arguments, IFileSystem fileSystem) { Logger.WriteInfo(string.Format("Running on {0}.", runningOnMono ? "Mono" : "Windows")); var noFetch = arguments.NoFetch; var authentication = arguments.Authentication; var targetPath = arguments.TargetPath; var targetUrl = arguments.TargetUrl; var dynamicRepositoryLocation = arguments.DynamicRepositoryLocation; var targetBranch = arguments.TargetBranch; var commitId = arguments.CommitId; var overrideConfig = arguments.HasOverrideConfig ? arguments.OverrideConfig : null; var executeCore = new ExecuteCore(fileSystem); var variables = executeCore.ExecuteGitVersion(targetUrl, dynamicRepositoryLocation, authentication, targetBranch, noFetch, targetPath, commitId, overrideConfig); if (arguments.Output == OutputType.BuildServer) { foreach (var buildServer in BuildServerList.GetApplicableBuildServers()) { buildServer.WriteIntegration(Console.WriteLine, variables); } } if (arguments.Output == OutputType.Json) { switch (arguments.ShowVariable) { case null: Console.WriteLine(JsonOutputFormatter.ToJson(variables)); break; default: string part; if (!variables.TryGetValue(arguments.ShowVariable, out part)) { throw new WarningException(string.Format("'{0}' variable does not exist", arguments.ShowVariable)); } Console.WriteLine(part); break; } } using (var assemblyInfoUpdate = new AssemblyInfoFileUpdate(arguments, targetPath, variables, fileSystem)) { var execRun = RunExecCommandIfNeeded(arguments, targetPath, variables); var msbuildRun = RunMsBuildIfNeeded(arguments, targetPath, variables); if (!execRun && !msbuildRun) { assemblyInfoUpdate.DoNotRestoreAssemblyInfo(); //TODO Put warning back //if (!context.CurrentBuildServer.IsRunningInBuildAgent()) //{ // Console.WriteLine("WARNING: Not running in build server and /ProjectFile or /Exec arguments not passed"); // Console.WriteLine(); // Console.WriteLine("Run GitVersion.exe /? for help"); //} } } }
/// <summary> /// Initializes a new instance of the <see cref="ProgressiveStreamWriter" /> class. /// </summary> /// <param name="path">The path.</param> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> public ProgressiveStreamWriter(string path, ILogger logger, IFileSystem fileSystem, TranscodingJob job) { Path = path; Logger = logger; _fileSystem = fileSystem; _job = job; }
public SessionHandler(ILogger<SessionHandler> logger, IEnvironment environment, IFileSystem fileSystem, IKeyValueStore keyValueStore, IMessageBus messageBus, ISession session, ITorrentInfoRepository torrentInfoRepository, ITorrentMetadataRepository metadataRepository) { if (logger == null) throw new ArgumentNullException("logger"); if (environment == null) throw new ArgumentNullException("environment"); if (fileSystem == null) throw new ArgumentNullException("fileSystem"); if (keyValueStore == null) throw new ArgumentNullException("keyValueStore"); if (messageBus == null) throw new ArgumentNullException("messageBus"); if (session == null) throw new ArgumentNullException("session"); if (torrentInfoRepository == null) throw new ArgumentNullException("torrentInfoRepository"); if (metadataRepository == null) throw new ArgumentNullException("metadataRepository"); _logger = logger; _environment = environment; _fileSystem = fileSystem; _keyValueStore = keyValueStore; _messageBus = messageBus; _session = session; _torrentInfoRepository = torrentInfoRepository; _metadataRepository = metadataRepository; _muted = new List<string>(); _alertsThread = new Thread(ReadAlerts); }
/// <summary> /// Initializes a new instance of the <see cref="ImageSaver"/> class. /// </summary> /// <param name="config">The config.</param> /// <param name="directoryWatchers">The directory watchers.</param> public ImageSaver(IServerConfigurationManager config, IDirectoryWatchers directoryWatchers, IFileSystem fileSystem) { _config = config; _directoryWatchers = directoryWatchers; _fileSystem = fileSystem; _remoteImageCache = new FileSystemRepository(config.ApplicationPaths.DownloadedImagesDataPath); }
public ScriptServices( IFileSystem fileSystem, IPackageAssemblyResolver packageAssemblyResolver, IScriptExecutor executor, IScriptEngine engine, IFilePreProcessor filePreProcessor, IReplCommandService replCommandService, IScriptPackResolver scriptPackResolver, IPackageInstaller packageInstaller, ILog logger, IAssemblyResolver assemblyResolver, IConsole console = null, IInstallationProvider installationProvider = null ) { FileSystem = fileSystem; PackageAssemblyResolver = packageAssemblyResolver; Executor = executor; Engine = engine; FilePreProcessor = filePreProcessor; ReplCommandService = replCommandService; ScriptPackResolver = scriptPackResolver; PackageInstaller = packageInstaller; Logger = logger; Console = console; AssemblyResolver = assemblyResolver; InstallationProvider = installationProvider; }
/// <summary> /// Initializes a new instance of the <see cref="ImageSaver" /> class. /// </summary> /// <param name="config">The config.</param> /// <param name="libraryMonitor">The directory watchers.</param> /// <param name="fileSystem">The file system.</param> /// <param name="logger">The logger.</param> public ImageSaver(IServerConfigurationManager config, ILibraryMonitor libraryMonitor, IFileSystem fileSystem, ILogger logger) { _config = config; _libraryMonitor = libraryMonitor; _fileSystem = fileSystem; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="PluginsController" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="pluginsService">The plugins service.</param> /// <param name="nugetService">The nuget service.</param> /// <param name="visualStudioService">The visual studio service.</param> /// <param name="readMeService">The read me service.</param> /// <param name="settingsService">The settings service.</param> /// <param name="messageBoxService">The message box service.</param> /// <param name="dialogService">The dialog service.</param> /// <param name="formsService">The forms service.</param> /// <param name="translator">The translator.</param> public PluginsController( IFileSystem fileSystem, IPluginsService pluginsService, INugetService nugetService, IVisualStudioService visualStudioService, IReadMeService readMeService, ISettingsService settingsService, IMessageBoxService messageBoxService, IDialogService dialogService, IFormsService formsService, ITranslator<Tuple<DirectoryInfoBase, DirectoryInfoBase>, Plugins> translator) : base(visualStudioService, readMeService, settingsService, messageBoxService, dialogService, formsService) { TraceService.WriteLine("PluginsController::Constructor"); this.fileSystem = fileSystem; this.pluginsService = pluginsService; this.nugetService = nugetService; this.translator = translator; }
protected WritableXapFile(string outputPath, IFileSystem fileSystem) : base(outputPath, fileSystem.OpenArchive(outputPath, ZipArchiveMode.Update)) { FileSystem = fileSystem; OutputPath = outputPath; OutputArchive = InputArchive; }
public GDIImageEncoder(IFileSystem fileSystem, ILogger logger) { _fileSystem = fileSystem; _logger = logger; LogInfo(); }
/// <summary> /// Sets the initial item values. /// </summary> /// <param name="item">The item.</param> /// <param name="args">The args.</param> /// <param name="fileSystem">The file system.</param> public static void SetInitialItemValues(BaseItem item, ItemResolveArgs args, IFileSystem fileSystem) { // If the resolver didn't specify this if (string.IsNullOrEmpty(item.Path)) { item.Path = args.Path; } // If the resolver didn't specify this if (args.Parent != null) { item.Parent = args.Parent; } item.Id = item.Path.GetMBId(item.GetType()); // If the resolver didn't specify this if (string.IsNullOrEmpty(item.DisplayMediaType)) { item.DisplayMediaType = item.GetType().Name; } // Make sure the item has a name EnsureName(item, args); item.DontFetchMeta = item.Path.IndexOf("[dontfetchmeta]", StringComparison.OrdinalIgnoreCase) != -1 || item.Parents.Any(i => i.IsLocked); // Make sure DateCreated and DateModified have values EntityResolutionHelper.EnsureDates(fileSystem, item, args, true); }
public ExecuteCore(IFileSystem fileSystem) { if (fileSystem == null) throw new ArgumentNullException("fileSystem"); this.fileSystem = fileSystem; gitVersionCache = new GitVersionCache(fileSystem); }
/// <summary> /// Initialize the file system. /// </summary> /// <param name="fileSystem">File system.</param> public static void Initialize(IFileSystem fileSystem) { ExceptionHelper.ThrowIfNull("fileSystem", fileSystem); Current = fileSystem; LogService.Debug("FileSystem :: Initialized with {0}.", fileSystem); }
public EpisodeProviderFromXml(ILogManager logManager, IServerConfigurationManager configurationManager, IItemRepository itemRepo, IFileSystem fileSystem) : base(logManager, configurationManager) { _itemRepo = itemRepo; _fileSystem = fileSystem; Current = this; }
public static void Move(this IFileSystem sourceFileSystem, FileSystemPath sourcePath, IFileSystem destinationFileSystem, FileSystemPath destinationPath) { IEntityMover mover; if (!EntityMovers.Registration.TryGetSupported(sourceFileSystem.GetType(), destinationFileSystem.GetType(), out mover)) throw new ArgumentException("The specified combination of file-systems is not supported."); mover.Move(sourceFileSystem, sourcePath, destinationFileSystem, destinationPath); }
private static XDocument CreateDocument(XName rootName, IFileSystem fileSystem, string path) { XDocument document = new XDocument(new XElement(rootName)); // Add it to the file system fileSystem.AddFile(path, document.Save); return document; }
private static XDocument GetDocument(IFileSystem fileSystem, string path) { using (Stream configStream = fileSystem.OpenFile(path)) { return XDocument.Load(configStream, LoadOptions.PreserveWhitespace); } }
public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem) { PathResolverPassedToCreateSharedRepository = pathResolver; FileSystemPassedToCreateSharedRepository = fileSystem; ConfigSettingsFileSystemPassedToCreateSharedRepository = configSettingsFileSystem; return FakeSharedRepository; }
protected override IPackageManager CreatePackageManager(IFileSystem packagesFolderFileSystem) { var sourceRepository = GetRepository(); var pathResolver = new CustomPackagePathResolver(packagesFolderFileSystem, true) { OverlayDirectory = OverlayPackageDirectory }; return new PackageManager(sourceRepository, pathResolver, packagesFolderFileSystem, new LocalPackageRepository(pathResolver, packagesFolderFileSystem)) { Logger = base.Console }; }
/// <summary> /// Initializes a new instance of the <see cref="FanArtAlbumProvider"/> class. /// </summary> /// <param name="httpClient">The HTTP client.</param> /// <param name="logManager">The log manager.</param> /// <param name="configurationManager">The configuration manager.</param> /// <param name="providerManager">The provider manager.</param> public FanArtAlbumProvider(IHttpClient httpClient, ILogManager logManager, IServerConfigurationManager configurationManager, IProviderManager providerManager, IFileSystem fileSystem) : base(logManager, configurationManager) { _providerManager = providerManager; _fileSystem = fileSystem; HttpClient = httpClient; }
public DeploymentStatusManager(IEnvironment environment, IFileSystem fileSystem) { _environment = environment; _fileSystem = fileSystem; _activeFile = Path.Combine(environment.DeploymentCachePath, Constants.ActiveDeploymentFile); }
public Hooks(IFileSystem fileSystem, Purl path) { _path = path; _fileSystem = fileSystem; _hookTypes.Add(new HookType("cmd", typeof(CmdExecHook))); _hookTypes.Add(new HookType("ps1", typeof(PowershellHook))); }
public static GameSystemViewModel MakePCFX(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNamePCFX, Strings.ManufacturerNameNEC, "\uf124", false, null, CDImageExtensions);
public TerraformPlanRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools) : base(fileSystem, environment, processRunner, tools) { }
public DotnetUtilsService(IFileSystem fileSystem, IDotnetCommandService dotNetCommandService) { _fileSystem = fileSystem; _dotnetCommandService = dotNetCommandService; }
public static GameSystemViewModel MakeArcade(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameArcade, Strings.ManufacturerNameFBAlpha, "\uf102", true);
public static GameSystemViewModel MakeNeoGeoPocket(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameNeoGeoPocket, Strings.ManufacturerNameSNK, "\uf129");
public static GameSystemViewModel MakeNeoGeo(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameNeoGeo, Strings.ManufacturerNameSNK, "\uf102", false);
public static GameSystemViewModel MakeWonderSwan(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameWonderSwan, Strings.ManufacturerNameBandai, "\uf129");
public static GameSystemViewModel MakePCEngine(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNamePCEngine, Strings.ManufacturerNameNEC, "\uf124", true, new HashSet <string> { ".pce" });
public static GameSystemViewModel MakeMegaCD(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameMegaCD, Strings.ManufacturerNameSega, "\uf124", false, new HashSet <string> { ".bin", ".cue", ".iso", ".chd" }, CDImageExtensions);
public static GameSystemViewModel MakePCEngineCD(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNamePCEngineCD, Strings.ManufacturerNameNEC, "\uf124", false, new HashSet <string> { ".cue", ".ccd", ".chd" }, CDImageExtensions);
public static GameSystemViewModel MakeGameGear(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameGameGear, Strings.ManufacturerNameSega, "\uf129", true, new HashSet <string> { ".gg" });
public static GameSystemViewModel MakePlayStation(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNamePlayStation, Strings.ManufacturerNameSony, "\uf128", false, null, CDImageExtensions);
public static GameSystemViewModel MakeSG1000(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameSG1000, Strings.ManufacturerNameSega, "\uf102", true, new HashSet <string> { ".sg" });
public static GameSystemViewModel MakeMegaDrive(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameMegaDrive, Strings.ManufacturerNameSega, "\uf124", true, new HashSet <string> { ".mds", ".md", ".smd", ".gen" });
public static GameSystemViewModel MakeGBA(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameGameBoyAdvance, Strings.ManufacturerNameNintendo, "\uf115");
public static GameSystemViewModel MakeMasterSystem(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameMasterSystem, Strings.ManufacturerNameSega, "\uf118", true, new HashSet <string> { ".sms" });
public CollectionFolderImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor) : base(fileSystem, providerManager, applicationPaths, imageProcessor) { }
public static GameSystemViewModel MakeDS(ICore core, IFileSystem fileSystem) => new GameSystemViewModel(core, fileSystem, Strings.SystemNameDS, Strings.ManufacturerNameNintendo, "\uf117");
public CollectionManager(ILibraryManager libraryManager, IApplicationPaths appPaths, ILocalizationManager localizationManager, IFileSystem fileSystem, ILibraryMonitor iLibraryMonitor, ILogger logger, IProviderManager providerManager) { _libraryManager = libraryManager; _fileSystem = fileSystem; _iLibraryMonitor = iLibraryMonitor; _logger = logger; _providerManager = providerManager; _localizationManager = localizationManager; _appPaths = appPaths; }
/// <summary> /// Initializes a new instance of the <see cref="ScheduledTaskWorker" /> class. /// </summary> /// <param name="scheduledTask">The scheduled task.</param> /// <param name="applicationPaths">The application paths.</param> /// <param name="taskManager">The task manager.</param> /// <param name="jsonSerializer">The json serializer.</param> /// <param name="logger">The logger.</param> /// <exception cref="System.ArgumentNullException"> /// scheduledTask /// or /// applicationPaths /// or /// taskManager /// or /// jsonSerializer /// or /// logger /// </exception> public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, IJsonSerializer jsonSerializer, ILogger logger, IFileSystem fileSystem) { if (scheduledTask == null) { throw new ArgumentNullException("scheduledTask"); } if (applicationPaths == null) { throw new ArgumentNullException("applicationPaths"); } if (taskManager == null) { throw new ArgumentNullException("taskManager"); } if (jsonSerializer == null) { throw new ArgumentNullException("jsonSerializer"); } if (logger == null) { throw new ArgumentNullException("logger"); } ScheduledTask = scheduledTask; ApplicationPaths = applicationPaths; TaskManager = taskManager; JsonSerializer = jsonSerializer; Logger = logger; _fileSystem = fileSystem; InitTriggerEvents(); }
public VillainFileRepository(string path, IFileSystem fileSystem) : base(path, fileSystem) { }
public TestCodegenJob(string baseOutputDir, IFileSystem fileSystem, DetailsStore detailsStore, bool force) : base(baseOutputDir, fileSystem, detailsStore, force) { AddOutputFile(relativeOutputPath); AddOutputFile(relativeTemplateOutputPath); }
public MusicAlbumResolver(ILogger logger, IFileSystem fileSystem, ILibraryManager libraryManager) { _logger = logger; _fileSystem = fileSystem; _libraryManager = libraryManager; }
public CollectionManagerEntryPoint(ICollectionManager collectionManager, IServerConfigurationManager config, IFileSystem fileSystem, ILogger logger) { _collectionManager = (CollectionManager)collectionManager; _config = config; _fileSystem = fileSystem; _logger = logger; }
protected BaseFileParser(IFileSystem fileSystem) { this.fileSystem = fileSystem; }
/// <summary> /// Determine if the supplied file data points to a music album /// </summary> /// <param name="path">The path.</param> /// <param name="directoryService">The directory service.</param> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <param name="libraryManager">The library manager.</param> /// <returns><c>true</c> if [is music album] [the specified data]; otherwise, <c>false</c>.</returns> public static bool IsMusicAlbum(string path, IDirectoryService directoryService, ILogger logger, IFileSystem fileSystem, ILibraryManager libraryManager) { return(ContainsMusic(directoryService.GetFileSystemEntries(path), true, directoryService, logger, fileSystem, libraryManager)); }
/// <summary> /// Creates a new Maven client /// </summary> /// <param name="fileSystem">A file system</param> /// <param name="localRepository">A local repository base path</param> /// <param name="remoteRepository">A remote repository client</param> public MavenClient(IFileSystem fileSystem, DirectoryPath localRepository, IWebClient remoteRepository) { this.fileSystem = fileSystem; this.localRepository = localRepository; this.remoteRepository = remoteRepository; }
private static bool IsAlbumSubfolder(FileSystemInfo directory, IDirectoryService directoryService, ILogger logger, IFileSystem fileSystem, ILibraryManager libraryManager) { var path = directory.FullName; if (IsMultiDiscFolder(path)) { logger.Debug("Found multi-disc folder: " + path); return(ContainsMusic(directoryService.GetFileSystemEntries(path), false, directoryService, logger, fileSystem, libraryManager)); } return(false); }
public static void CreateDirectory(this IFileSystem fileSystem, params string[] pathParts) { fileSystem.CreateDirectory(FileSystem.Combine(pathParts)); }
private void EnsureItems() { FileSystemProvider p = FileSystemManager.Providers[WebConfigSettings.FileSystemProvider]; if (p == null) { log.Error("File System Provider Could Not Be Loaded."); return; } IFileSystem fileSystem = p.GetFileSystem(); if (fileSystem == null) { log.Error("File System Could Not Be Loaded."); return; } //string virtualPath = fileSystem.VirtualRoot; if (ddDefinitions == null) { ddDefinitions = new DropDownList(); if (this.Controls.Count == 0) { this.Controls.Add(ddDefinitions); } } if (ddDefinitions.Items.Count > 0) { return; } string siteSuperFlexiPath = "~/Data/Sites/" + siteSettings.SiteId.ToInvariantString() + "/SuperFlexi/"; string globalSuperFlexiPath = "~/Data/SuperFlexi/"; Dictionary <string, string> solutions = new Dictionary <string, string>(); List <string> names = new List <string>(); List <SolutionFileLocation> solutionLocations = new List <SolutionFileLocation>() { new SolutionFileLocation { Path = siteSuperFlexiPath + "Solutions/", Extension = ".sfmarkup", RecurseLevel = RecurseLevel.OneLevel, Global = false }, new SolutionFileLocation { Path = siteSuperFlexiPath + "MarkupDefinitions/", Extension = ".config", RecurseLevel = RecurseLevel.TopDirectoryOnly, Global = false }, new SolutionFileLocation { Path = globalSuperFlexiPath + "Solutions/", Extension = ".sfmarkup", RecurseLevel = RecurseLevel.OneLevel, Global = true }, new SolutionFileLocation { Path = globalSuperFlexiPath + "MarkupDefinitions/", Extension = ".config", RecurseLevel = RecurseLevel.TopDirectoryOnly, Global = true } }; foreach (var location in solutionLocations) { //WebFolder folder = new WebFolder(); //DirectoryInfo dir = new DirectoryInfo(HttpContext.Current.Server.MapPath(location.Path)); //if (dir.Exists) if (fileSystem.FolderExists(location.Path)) { List <WebFile> files = new List <WebFile>(); switch (location.RecurseLevel) { case RecurseLevel.OneLevel: var folders = fileSystem.GetFolderList(location.Path); foreach (var folder in folders) { files.AddRange(fileSystem.GetFileList(folder.VirtualPath).Where(f => f.Extension.ToLower() == location.Extension)); } break; case RecurseLevel.TopDirectoryOnly: files.AddRange(fileSystem.GetFileList(location.Path).Where(f => f.Extension.ToLower() == location.Extension)); break; } //foreach (FileInfo file in dir.GetFiles(location.Pattern, location.SearchOption)) foreach (var file in files) { //if (File.Exists(file.FullName)) //{ string nameAppendage = string.Empty; if (location.Global) { nameAppendage = " (global)"; } XmlDocument doc = new XmlDocument(); doc.Load(file.Path); XmlNode node = doc.DocumentElement.SelectSingleNode("/Definitions/MarkupDefinition"); if (node != null) { XmlAttributeCollection attrCollection = node.Attributes; string solutionName = string.Empty; if (attrCollection["name"] != null) { solutionName = attrCollection["name"].Value + nameAppendage;; } else { solutionName = file.Name.ToString().ToLower().Replace(location.Extension, "") + nameAppendage;; } names.Add(solutionName); if (solutions.ContainsKey(solutionName)) { solutionName += string.Format(" [{0}]", names.Where(n => n.Equals(solutionName)).Count()); } //todo: add capability to nest folders in a solution folder? solutions.Add( solutionName, //location.Path + (location.RecurseLevel == RecurseLevel.ImmediateSubDirectory ? file.Directory.Name + "/" : "") + file.Name); file.VirtualPath.Replace("\\", "/").TrimStart('~')); } //} } } } ddDefinitions.DataSource = solutions.OrderBy(i => i.Key); ddDefinitions.DataTextField = "Key"; ddDefinitions.DataValueField = "Value"; ddDefinitions.DataBind(); ddDefinitions.Items.Insert(0, new ListItem(SuperFlexiResources.SolutionDropDownPleaseSelect, "0")); }