From c0b22c43498e5a0511ab860fa7edbdb38330cf9d Mon Sep 17 00:00:00 2001 From: jakobdyrby Date: Fri, 9 May 2014 14:00:07 +0200 Subject: [PATCH] renamed a class --- ....cs => ConflictingPackageContentFinder.cs} | 4 +-- ...cs => IConflictingPackageContentFinder.cs} | 2 +- .../Services/PackageInstallerService.cs | 25 ++++++++++--------- src/Umbraco.Core/Umbraco.Core.csproj | 4 +-- 4 files changed, 18 insertions(+), 17 deletions(-) rename src/Umbraco.Core/Services/{PackageValidationHelper.cs => ConflictingPackageContentFinder.cs} (85%) rename src/Umbraco.Core/Services/{IPackageValidationHelper.cs => IConflictingPackageContentFinder.cs} (83%) diff --git a/src/Umbraco.Core/Services/PackageValidationHelper.cs b/src/Umbraco.Core/Services/ConflictingPackageContentFinder.cs similarity index 85% rename from src/Umbraco.Core/Services/PackageValidationHelper.cs rename to src/Umbraco.Core/Services/ConflictingPackageContentFinder.cs index 87495a4652..3eef651fe8 100644 --- a/src/Umbraco.Core/Services/PackageValidationHelper.cs +++ b/src/Umbraco.Core/Services/ConflictingPackageContentFinder.cs @@ -3,12 +3,12 @@ using Umbraco.Core.Models; namespace Umbraco.Core.Services { - public class PackageValidationHelper : IPackageValidationHelper + public class ConflictingPackageContentFinder : IConflictingPackageContentFinder { private readonly IMacroService _macroService; private readonly IFileService _fileService; - public PackageValidationHelper(IMacroService macroService, + public ConflictingPackageContentFinder(IMacroService macroService, IFileService fileService) { if (fileService != null) _fileService = fileService; diff --git a/src/Umbraco.Core/Services/IPackageValidationHelper.cs b/src/Umbraco.Core/Services/IConflictingPackageContentFinder.cs similarity index 83% rename from src/Umbraco.Core/Services/IPackageValidationHelper.cs rename to src/Umbraco.Core/Services/IConflictingPackageContentFinder.cs index dbbbeafd61..d4715aecbe 100644 --- a/src/Umbraco.Core/Services/IPackageValidationHelper.cs +++ b/src/Umbraco.Core/Services/IConflictingPackageContentFinder.cs @@ -2,7 +2,7 @@ namespace Umbraco.Core.Services { - public interface IPackageValidationHelper + public interface IConflictingPackageContentFinder { bool StylesheetExists(string styleSheetName, out IStylesheet existingStylesheet); bool TemplateExists(string templateAlias, out ITemplate existingTemplate); diff --git a/src/Umbraco.Core/Services/PackageInstallerService.cs b/src/Umbraco.Core/Services/PackageInstallerService.cs index 2462e5ef5b..53fc3bf6ca 100644 --- a/src/Umbraco.Core/Services/PackageInstallerService.cs +++ b/src/Umbraco.Core/Services/PackageInstallerService.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Services private readonly IFileService _fileService; private readonly IMacroService _macroService; private readonly IPackagingService _packagingService; - private IPackageValidationHelper _packageValidationHelper; + private IConflictingPackageContentFinder _conflictingPackageContentFinder; private IUnpackHelper _unpackHelper; public PackageInstallerService(IPackagingService packagingService, IMacroService macroService, @@ -32,20 +32,20 @@ namespace Umbraco.Core.Services } - public IPackageValidationHelper PackageValidationHelper + public IConflictingPackageContentFinder ConflictingPackageContentFinder { private get { - return _packageValidationHelper ?? - (_packageValidationHelper = new PackageValidationHelper(_macroService, _fileService)); + return _conflictingPackageContentFinder ?? + (_conflictingPackageContentFinder = new ConflictingPackageContentFinder(_macroService, _fileService)); } set { - if (_packageValidationHelper != null) + if (_conflictingPackageContentFinder != null) { - throw new PropertyConstraintException("This property allraedy have a value"); + throw new PropertyConstraintException("This property already have a value"); } - _packageValidationHelper = value; + _conflictingPackageContentFinder = value; } } @@ -57,7 +57,7 @@ namespace Umbraco.Core.Services { if (_unpackHelper != null) { - throw new PropertyConstraintException("This property allraedy have a value"); + throw new PropertyConstraintException("This property already have a value"); } _unpackHelper = value; } @@ -72,7 +72,7 @@ namespace Umbraco.Core.Services if (_fullpathToRoot != null) { - throw new PropertyConstraintException("This property allraedy have a value"); + throw new PropertyConstraintException("This property already have a value"); } _fullpathToRoot = value; @@ -426,7 +426,7 @@ namespace Umbraco.Core.Services string name = xElement.Value; IStylesheet existingStyleSheet; - if (PackageValidationHelper.StylesheetExists(name, out existingStyleSheet)) + if (ConflictingPackageContentFinder.StylesheetExists(name, out existingStyleSheet)) { // Don't know what to put in here... existing path was the best i could come up with return existingStyleSheet; @@ -457,7 +457,7 @@ namespace Umbraco.Core.Services ITemplate existingTemplate; - if (PackageValidationHelper.TemplateExists(aliasStr, out existingTemplate)) + if (ConflictingPackageContentFinder.TemplateExists(aliasStr, out existingTemplate)) { return existingTemplate; } @@ -481,7 +481,7 @@ namespace Umbraco.Core.Services string alias = xElement.Value; IMacro existingMacro; - if (PackageValidationHelper.MacroExists(alias, out existingMacro)) + if (ConflictingPackageContentFinder.MacroExists(alias, out existingMacro)) { return existingMacro; } @@ -494,6 +494,7 @@ namespace Umbraco.Core.Services private bool IsFileNodeUnsecure(FileInPackageInfo fileInPackageInfo) { + // Should be done with regex :) if (fileInPackageInfo.Directory.ToLower().Contains(IOHelper.DirSepChar + "app_code")) return true; if (fileInPackageInfo.Directory.ToLower().Contains(IOHelper.DirSepChar + "bin")) return true; diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index a2475919fc..65cfa61f54 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -1048,7 +1048,7 @@ - + @@ -1065,7 +1065,7 @@ - +