* Rename Umbraco.Core namespace to Umbraco.Cms.Core * Move extension methods in core project to Umbraco.Extensions * Move extension methods in core project to Umbraco.Extensions * Rename Umbraco.Examine namespace to Umbraco.Cms.Examine * Move examine extensions to Umbraco.Extensions namespace * Reflect changed namespaces in Builder and fix unit tests * Adjust namespace in Umbraco.ModelsBuilder.Embedded * Adjust namespace in Umbraco.Persistence.SqlCe * Adjust namespace in Umbraco.PublishedCache.NuCache * Align namespaces in Umbraco.Web.BackOffice * Align namespaces in Umbraco.Web.Common * Ensure that SqlCeSupport is still enabled after changing the namespace * Align namespaces in Umbraco.Web.Website * Align namespaces in Umbraco.Web.UI.NetCore * Align namespaces in Umbraco.Tests.Common * Align namespaces in Umbraco.Tests.UnitTests * Align namespaces in Umbraco.Tests.Integration * Fix errors caused by changed namespaces * Fix integration tests * Undo the Umbraco.Examine.Lucene namespace change This breaks integration tests on linux, since the namespace wont exists there because it's only used on windows. * Fix merge * Fix Merge
92 lines
3.9 KiB
C#
92 lines
3.9 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Umbraco.Cms.Core.Deploy
|
|
{
|
|
/// <summary>
|
|
/// Represents a file source, ie a mean for a target environment involved in a
|
|
/// deployment to obtain the content of files being deployed.
|
|
/// </summary>
|
|
public interface IFileSource
|
|
{
|
|
/// <summary>
|
|
/// Gets the content of a file as a stream.
|
|
/// </summary>
|
|
/// <param name="udi">A file entity identifier.</param>
|
|
/// <returns>A stream with read access to the file content.</returns>
|
|
/// <remarks>
|
|
/// <para>Returns null if no content could be read.</para>
|
|
/// <para>The caller should ensure that the stream is properly closed/disposed.</para>
|
|
/// </remarks>
|
|
Stream GetFileStream(StringUdi udi);
|
|
|
|
/// <summary>
|
|
/// Gets the content of a file as a stream.
|
|
/// </summary>
|
|
/// <param name="udi">A file entity identifier.</param>
|
|
/// <param name="token">A cancellation token.</param>
|
|
/// <returns>A stream with read access to the file content.</returns>
|
|
/// <remarks>
|
|
/// <para>Returns null if no content could be read.</para>
|
|
/// <para>The caller should ensure that the stream is properly closed/disposed.</para>
|
|
/// </remarks>
|
|
Task<Stream> GetFileStreamAsync(StringUdi udi, CancellationToken token);
|
|
|
|
/// <summary>
|
|
/// Gets the content of a file as a string.
|
|
/// </summary>
|
|
/// <param name="udi">A file entity identifier.</param>
|
|
/// <returns>A string containing the file content.</returns>
|
|
/// <remarks>Returns null if no content could be read.</remarks>
|
|
string GetFileContent(StringUdi udi);
|
|
|
|
/// <summary>
|
|
/// Gets the content of a file as a string.
|
|
/// </summary>
|
|
/// <param name="udi">A file entity identifier.</param>
|
|
/// <param name="token">A cancellation token.</param>
|
|
/// <returns>A string containing the file content.</returns>
|
|
/// <remarks>Returns null if no content could be read.</remarks>
|
|
Task<string> GetFileContentAsync(StringUdi udi, CancellationToken token);
|
|
|
|
/// <summary>
|
|
/// Gets the length of a file.
|
|
/// </summary>
|
|
/// <param name="udi">A file entity identifier.</param>
|
|
/// <returns>The length of the file, or -1 if the file does not exist.</returns>
|
|
long GetFileLength(StringUdi udi);
|
|
|
|
/// <summary>
|
|
/// Gets the length of a file.
|
|
/// </summary>
|
|
/// <param name="udi">A file entity identifier.</param>
|
|
/// <param name="token">A cancellation token.</param>
|
|
/// <returns>The length of the file, or -1 if the file does not exist.</returns>
|
|
Task<long> GetFileLengthAsync(StringUdi udi, CancellationToken token);
|
|
|
|
/// <summary>
|
|
/// Gets files and store them using a file store.
|
|
/// </summary>
|
|
/// <param name="udis">The udis of the files to get.</param>
|
|
/// <param name="fileTypes">A collection of file types which can store the files.</param>
|
|
void GetFiles(IEnumerable<StringUdi> udis, IFileTypeCollection fileTypes);
|
|
|
|
/// <summary>
|
|
/// Gets files and store them using a file store.
|
|
/// </summary>
|
|
/// <param name="udis">The udis of the files to get.</param>
|
|
/// <param name="fileTypes">A collection of file types which can store the files.</param>
|
|
/// <param name="token">A cancellation token.</param>
|
|
Task GetFilesAsync(IEnumerable<StringUdi> udis, IFileTypeCollection fileTypes, CancellationToken token);
|
|
|
|
///// <summary>
|
|
///// Gets the content of a file as a bytes array.
|
|
///// </summary>
|
|
///// <param name="Udi">A file entity identifier.</param>
|
|
///// <returns>A byte array containing the file content.</returns>
|
|
//byte[] GetFileBytes(StringUdi Udi);
|
|
}
|
|
}
|