deploy-30 - fixes

This commit is contained in:
Stephan
2016-04-15 13:25:11 +02:00
parent 523283acd0
commit 378e8f5cd9
23 changed files with 161 additions and 114 deletions

View File

@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Media;
namespace Umbraco.Core.IO
{
@@ -26,6 +27,8 @@ namespace Umbraco.Core.IO
_contentConfig = contentConfig;
}
// none of the methods below are used in Core anymore
[Obsolete("This low-level method should NOT exist.")]
public string GetRelativePath(int propertyId, string fileName)
{
@@ -36,7 +39,7 @@ namespace Umbraco.Core.IO
return propertyId.ToString(CultureInfo.InvariantCulture) + sep + fileName;
}
[Obsolete("This low-level method should NOT exist.")]
[Obsolete("This low-level method should NOT exist.", false)]
public string GetRelativePath(string subfolder, string fileName)
{
var sep = _contentConfig.UploadAllowDirectories
@@ -46,50 +49,28 @@ namespace Umbraco.Core.IO
return subfolder + sep + fileName;
}
// what's below is weird
// we are not deleting custom thumbnails
// MediaFileSystem is not just IFileSystem
// etc
[Obsolete("", true)]
[Obsolete("Use ImageHelper.GetThumbnails instead.", false)]
public IEnumerable<string> GetThumbnails(string path)
{
var parentDirectory = Path.GetDirectoryName(path);
var extension = Path.GetExtension(path);
return GetFiles(parentDirectory)
.Where(x => x.StartsWith(path.TrimEnd(extension) + "_thumb") || x.StartsWith(path.TrimEnd(extension) + "_big-thumb"))
.ToList();
{
return ImageHelper.GetThumbnails(this, path);
}
[Obsolete("", true)]
[Obsolete("Use ImageHelper.DeleteFile instead.", false)]
public void DeleteFile(string path, bool deleteThumbnails)
{
DeleteFile(path);
if (deleteThumbnails == false)
return;
DeleteThumbnails(path);
ImageHelper.DeleteFile(this, path, deleteThumbnails);
}
[Obsolete("", true)]
[Obsolete("Use ImageHelper.DeleteThumbnails instead.", false)]
public void DeleteThumbnails(string path)
{
GetThumbnails(path)
.ForEach(DeleteFile);
ImageHelper.DeleteThumbnails(this, path);
}
[Obsolete("", true)]
[Obsolete("Use ImageHelper.CopyThumbnails instead.", false)]
public void CopyThumbnails(string sourcePath, string targetPath)
{
var targetPathBase = Path.GetDirectoryName(targetPath) ?? "";
foreach (var sourceThumbPath in GetThumbnails(sourcePath))
{
var sourceThumbFilename = Path.GetFileName(sourceThumbPath) ?? "";
var targetThumbPath = Path.Combine(targetPathBase, sourceThumbFilename);
this.CopyFile(sourceThumbPath, targetThumbPath);
}
ImageHelper.CopyThumbnails(this, sourcePath, targetPath);
}
}
}