using System;
using System.Collections.Generic;
using System.IO;
using Umbraco.Core.Models;
namespace Umbraco.Core.IO
{
///
/// Provides methods allowing the manipulation of media files.
///
public interface IMediaFileSystem : IFileSystem
{
///
/// Delete media files.
///
/// Files to delete (filesystem-relative paths).
void DeleteMediaFiles(IEnumerable files);
///
/// Gets the file path of a media file.
///
/// The file name.
/// The unique identifier of the content/media owning the file.
/// The unique identifier of the property type owning the file.
/// The filesystem-relative path to the media file.
/// With the old media path scheme, this CREATES a new media path each time it is invoked.
string GetMediaPath(string filename, Guid cuid, Guid puid);
///
/// Gets the file path of a media file.
///
/// The file name.
/// A previous file path.
/// The unique identifier of the content/media owning the file.
/// The unique identifier of the property type owning the file.
/// The filesystem-relative path to the media file.
/// In the old, legacy, number-based scheme, we try to re-use the media folder
/// specified by . Else, we CREATE a new one. Each time we are invoked.
string GetMediaPath(string filename, string prevpath, Guid cuid, Guid puid);
///
/// Stores a media file associated to a property of a content item.
///
/// The content item owning the media file.
/// The property type owning the media file.
/// The media file name.
/// A stream containing the media bytes.
/// An optional filesystem-relative filepath to the previous media file.
/// The filesystem-relative filepath to the media file.
///
/// The file is considered "owned" by the content/propertyType.
/// If an is provided then that file (and associated thumbnails if any) is deleted
/// before the new file is saved, and depending on the media path scheme, the folder may be reused for the new file.
///
string StoreFile(IContentBase content, PropertyType propertyType, string filename, Stream filestream, string oldpath);
///
/// Copies a media file as a new media file, associated to a property of a content item.
///
/// The content item owning the copy of the media file.
/// The property type owning the copy of the media file.
/// The filesystem-relative path to the source media file.
/// The filesystem-relative path to the copy of the media file.
string CopyFile(IContentBase content, PropertyType propertyType, string sourcepath);
}
}